We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For the following test1.py file, futurize works just fine:
test1.py
from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from __future__ import division from future import standard_library standard_library.install_aliases() from builtins import * def foo(): print('foo')
But for the same file with slightly differently organized imports:
from __future__ import ( absolute_import, unicode_literals, print_function, division ) from future import standard_library standard_library.install_aliases() from builtins import * def foo(): print('foo')
futurize fails with the following traceback:
Traceback (most recent call last): File "/usr/local/bin/futurize", line 9, in <module> load_entry_point('future', 'console_scripts', 'futurize')() File "/home/valloric/repos/python-future/src/libfuturize/main.py", line 293, in main options.processes) File "/usr/lib/python2.7/lib2to3/refactor.py", line 706, in refactor items, write, doctests_only) File "/usr/lib/python2.7/lib2to3/refactor.py", line 301, in refactor self.refactor_file(dir_or_file, write, doctests_only) File "/usr/lib/python2.7/lib2to3/refactor.py", line 747, in refactor_file *args, **kwargs) File "/usr/lib/python2.7/lib2to3/refactor.py", line 354, in refactor_file tree = self.refactor_string(input, filename) File "/usr/lib/python2.7/lib2to3/refactor.py", line 386, in refactor_string self.refactor_tree(tree, name) File "/usr/lib/python2.7/lib2to3/refactor.py", line 460, in refactor_tree new = fixer.transform(node, results) File "/home/valloric/repos/python-future/src/libpasteurize/fixes/fix_add_all__future__imports.py", line 21, in transform future_import(u"unicode_literals", node) File "/home/valloric/repos/python-future/src/libfuturize/fixer_util.py", line 249, in future_import names = check_future_import(node) File "/home/valloric/repos/python-future/src/libfuturize/fixer_util.py", line 468, in check_future_import assert False, "strange import: %s" % savenode AssertionError: strange import: from __future__ import ( absolute_import, unicode_literals, print_function, division )
Futurize call: futurize -v -w -u -a -2 -n test.py
futurize -v -w -u -a -2 -n test.py
The text was updated successfully, but these errors were encountered:
Dupe of #113.
Sorry, something went wrong.
No branches or pull requests
For the following
test1.py
file, futurize works just fine:But for the same file with slightly differently organized imports:
futurize fails with the following traceback:
Futurize call:
futurize -v -w -u -a -2 -n test.py
The text was updated successfully, but these errors were encountered: