You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specifying fixers to exclude, these options appear to have no effect, and when specifying fixers to include, modernize fails with an import error:
Traceback (most recent call last):
File "/Users/dan/.virtualenvs/python3port/bin/python-modernize", line 11, in <module>
sys.exit(main())
File "/Users/dan/.virtualenvs/python3port/lib/python2.7/site-packages/libmodernize/main.py", line 129, in main
options.nobackups, not options.no_diffs)
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/lib2to3/main.py", line 63, in __init__
super(StdoutRefactoringTool, self).__init__(fixers, options, explicit)
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/lib2to3/refactor.py", line 698, in __init__
super(MultiprocessRefactoringTool, self).__init__(*args, **kwargs)
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/lib2to3/refactor.py", line 210, in __init__
self.pre_order, self.post_order = self.get_fixers()
File "/usr/local/var/pyenv/versions/2.7.11/lib/python2.7/lib2to3/refactor.py", line 245, in get_fixers
mod = __import__(fix_mod_path, {}, {}, ["*"])
ImportError: No module named import
I am using version 0.5 installed into a new Python 2.7.11 virtualenv with nothing else, on OS X.
It looks like the issue is coming from lib2to3, but it's happening when I follow the documentation for modernize, so reporting it here.
The text was updated successfully, but these errors were encountered:
I'm guessing you're using the short names. You need to use the full names as returned by python-modernize -l. E.g. libmodernize.fixes.fix_map. It would be a nice addition for it to work with short names, though.
Selecting fixers by short name is #27. If the reporter confirms that was the problem, we can close this (or perhaps make this ticket about improving the error reporting).
Ah I'm sorry, I didn't find that bit in the documentation. Perhaps the line in the documentation about that could be emphasised. One way of doing this would be to make the section titles for the fixers the full dotted paths?
When specifying fixers to exclude, these options appear to have no effect, and when specifying fixers to include, modernize fails with an import error:
I am using version 0.5 installed into a new Python 2.7.11 virtualenv with nothing else, on OS X.
It looks like the issue is coming from lib2to3, but it's happening when I follow the documentation for modernize, so reporting it here.
The text was updated successfully, but these errors were encountered: