[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "gen-make.py --debug" with Python 3 fails with TypeError

From: Yasuhito FUTATSUKI <futatuki_at_poem.co.jp>
Date: Thu, 23 Apr 2020 07:14:22 +0900

Let's take easier one to analyze :)

On 2020/04/23 6:08, Johan Corveleyn wrote:
> On Wed, Apr 22, 2020 at 10:09 PM Daniel Shahaf <d.s_at_daniel.shahaf.name>
> wrote:
>
>> Johan Corveleyn wrote on Wed, 22 Apr 2020 19:16 +00:00:
>>> Running "gen-make.py --debug" with Python 3 fails with:
 
> Thanks, but now it fails earlier with this error (same with Yasuhito's
> attempt, which is equivalent I guess):

Yes, they are equivalent.

> [[[
> python gen-make.py --debug
> --with-httpd=C:\research\svn\dev\deps\httpd-2.4.43
> --with-serf=C:\research\svn\dev\deps\serf-1.3.9
> --with-openssl=C:\research\svn\dev\deps\openssl-1.1.1f
> --with-sqlite=C:\research\svn\dev\deps\sqlite-amalgamation-3.31.1.0
> --with-zlib=C:\research\svn\dev\deps\zlib-1.2.11
> --with-swig=C:\research\swigwin-3.0.12 --with-py3c=C:\research\py3c
> --with-jdk="C:\Program Files (x86)\AdoptOpenJDK\jdk-11.0.6.10-hotspot"
> --with-junit=C:\research\svn\dev\deps\junit-4.12\junit.jar
> --vsnet-version=2019 -t vcproj 2>&1 | tee log.gen-make
> Generating for Visual Studio 2019
>
> Found apr 1.6.5
> Found apr-util 1.6.1
> Found apr_memcache 1.6.1
> Found expat 2.2.9
> Found httpd 2.4.43
> Found java-sdk 11.0.6
> Found mod_dav 2.4.43
> Found openssl 1.1.1f
> Found perl 5.30.2
> Found py3c 1.0
> Found python 3.7.7
> Found ruby 2.7.0
> Found serf 1.3.9
> Found sqlite 3.31.1
> Found swig 3.0.12
> Found zlib 1.2.11
> Using bundled lz4 1.7.5
> Using bundled utf8proc 2.1.0
> Traceback (most recent call last):
> File "gen-make.py", line 327, in <module>
> main(conf, gentype, skip_depends=skip, other_options=rest.list)
> File "gen-make.py", line 74, in main
> sorted_targets.sort(key = lambda dep: dep.filename)
> File "gen-make.py", line 74, in <lambda>
> sorted_targets.sort(key = lambda dep: dep.filename)
> AttributeError: 'str' object has no attribute 'filename'
> ]]]

With previous errorand this, earch element of sorted_targets
can be str or ObjectFile objects, I assume. ObjectFile has
__str__ method, then it can be ...

[[[
Index: gen-make.py
===================================================================
--- gen-make.py (revision 1872433)
+++ gen-make.py (working copy)
@@ -70,7 +70,7 @@
 
   if ('--debug', '') in other_options:
     for dep_type, target_dict in generator.graph.deps.items():
- sorted_targets = list(target_dict.keys()); sorted_targets.sort()
+ sorted_targets = sorted(target_dict.keys(), key=str)
       for target in sorted_targets:
         print(dep_type + ": " + _objinfo(target))
         for source in target_dict[target]:
]]]

Cheers,

-- 
Yasuhito FUTATSUKI <futatuki_at_yf.bsdclub.org> / <futatuki_at_poem.co.jp>
Received on 2020-04-23 00:17:13 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.