Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'cmp' is an invalid keyword argument for sort() #3

Open
manhvela opened this issue May 9, 2022 · 2 comments
Open

TypeError: 'cmp' is an invalid keyword argument for sort() #3

manhvela opened this issue May 9, 2022 · 2 comments

Comments

@manhvela
Copy link

manhvela commented May 9, 2022

Hello there,

I followed your instructions but I get the following error:

Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/manhvela/Desktop/pysvg2font-master/pysvg2font/main.py", line 37, in
fontgenerator=SvgToFontGenerator(args.svg_source_directory,
File "/home/manhvela/Desktop/pysvg2font-master/pysvg2font/init.py", line 71, in init
self.source_svg_files = self.collect_svg_files()
File "/home/manhvela/Desktop/pysvg2font-master/pysvg2font/init.py", line 97, in collect_svg_files
svg_files.sort(cmp=lambda a, b: a.name.lower() > b.name.lower)
TypeError: 'cmp' is an invalid keyword argument for sort()

Could you help me?

@carrasti
Copy link
Owner

Hi, it is a while I don't use and mainatin this library, and it is quite likely it is not compatible with modern python. I believe the cmp argument has been removed from list sort() method in favour of key, some background here https://docs.python.org/3/howto/sorting.html#the-old-way-using-the-cmp-parameter

@manhvela
Copy link
Author

Hi, it is a while I don't use and mainatin this library, and it is quite likely it is not compatible with modern python. I believe the cmp argument has been removed from list sort() method in favour of key, some background here https://docs.python.org/3/howto/sorting.html#the-old-way-using-the-cmp-parameter

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants