[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 05:16:18 +0900

On 2020/04/23 4:16, Johan Corveleyn wrote:
> Running "gen-make.py --debug" with Python 3 fails with:
>
> [[[
> Traceback (most recent call last):
> File "gen-make.py", line 326, in <module>
> main(conf, gentype, skip_depends=skip, other_options=rest.list)
> File "gen-make.py", line 73, in main
> sorted_targets = list(target_dict.keys()); sorted_targets.sort()
> TypeError: '<' not supported between instances of 'ObjectFile' and
> 'ObjectFile'
> ]]]
 
I'm not sure what should be a sort key in this context, but probably...

[[[
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=lambda x: x.filename)
       for target in sorted_targets:
         print(dep_type + ": " + _objinfo(target))
         for source in target_dict[target]:
]]]
(I didn't check at all, even syntax error)

Cheers,

-- 
Yasuhito FUTATSUKI <futatuki_at_poem.co.jp>
Received on 2020-04-22 22:18:59 CEST

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