File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,7 @@ def future_import(feature, node):
243243 # Is it a shebang or encoding line?
244244 if is_shebang_comment (node ) or is_encoding_comment (node ):
245245 shebang_encoding_idx = idx
246+ continue
246247 if is_docstring (node ):
247248 # skip over docstring
248249 continue
@@ -443,7 +444,10 @@ def check_future_import(node):
443444 hasattr (node .children [1 ], 'value' ) and
444445 node .children [1 ].value == u'__future__' ):
445446 return set ()
446- node = node .children [3 ]
447+ if node .children [3 ].type == token .LPAR :
448+ node = node .children [4 ]
449+ else :
450+ node = node .children [3 ]
447451 # now node is the import_as_name[s]
448452 # print(python_grammar.number2symbol[node.type]) # breaks sometimes
449453 if node .type == syms .import_as_names :
You can’t perform that action at this time.
0 commit comments