Skip to content

Commit

Permalink
Fix #113
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviut committed Sep 3, 2018
1 parent 39a066e commit 4332803
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libfuturize/fixer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def future_import(feature, node):
# Is it a shebang or encoding line?
if is_shebang_comment(node) or is_encoding_comment(node):
shebang_encoding_idx = idx
continue
if is_docstring(node):
# skip over docstring
continue
Expand Down Expand Up @@ -443,7 +444,10 @@ def check_future_import(node):
hasattr(node.children[1], 'value') and
node.children[1].value == u'__future__'):
return set()
node = node.children[3]
if node.children[3].type == token.LPAR:
node = node.children[4]
else:
node = node.children[3]
# now node is the import_as_name[s]
# print(python_grammar.number2symbol[node.type]) # breaks sometimes
if node.type == syms.import_as_names:
Expand Down

0 comments on commit 4332803

Please sign in to comment.