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
Running futurize -1 -a -w file.py on a file that contains from __future__ import (division, print_statement) (from some previous work, for example), fails with:
Traceback (most recent call last):
File "/usr/bin/futurize", line 9, in <module>
load_entry_point('future==0.14.1', 'console_scripts', 'futurize')()
File "/usr/lib/python2.7/site-packages/libfuturize/main.py", line 295, in main
options.processes)
File "/usr/lib64/python2.7/lib2to3/refactor.py", line 706, in refactor
items, write, doctests_only)
File "/usr/lib64/python2.7/lib2to3/refactor.py", line 301, in refactor
self.refactor_file(dir_or_file, write, doctests_only)
File "/usr/lib64/python2.7/lib2to3/refactor.py", line 747, in refactor_file
*args, **kwargs)
File "/usr/lib64/python2.7/lib2to3/refactor.py", line 354, in refactor_file
tree = self.refactor_string(input, filename)
File "/usr/lib64/python2.7/lib2to3/refactor.py", line 386, in refactor_string
self.refactor_tree(tree, name)
File "/usr/lib64/python2.7/lib2to3/refactor.py", line 460, in refactor_tree
new = fixer.transform(node, results)
File "/usr/lib/python2.7/site-packages/libfuturize/fixes/fix_add__future__imports_except_unicode_literals.py", line 24, in transform
future_import(u"print_function", node)
File "/usr/lib/python2.7/site-packages/libfuturize/fixer_util.py", line 210, in future_import
names = check_future_import(node)
File "/usr/lib/python2.7/site-packages/libfuturize/fixer_util.py", line 424, in check_future_import
assert False, "strange import: %s" % savenode
AssertionError: strange import:
from __future__ import (division, print_function)
Note: Multiple imports on one line are usually against PEP8, but it seems that pep8 doesn't mind it with __future__ imports... Sorry, import x, y, z is against PEP8, but from a import x, y z is fine.
The text was updated successfully, but these errors were encountered:
Running
futurize -1 -a -w file.py
on a file that containsfrom __future__ import (division, print_statement)
(from some previous work, for example), fails with:Note: Multiple imports on one line are usually against PEP8, but it seems that pep8 doesn't mind it withSorry,__future__
imports...import x, y, z
is against PEP8, butfrom a import x, y z
is fine.The text was updated successfully, but these errors were encountered: