Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Properly check for from __future__ import.

  • Loading branch information...
commit 522971f0a688020c05fa84f1762b3cabf96cb73b 1 parent 0db885e
@loewis loewis authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 libmodernize/__init__.py
View
4 libmodernize/__init__.py
@@ -11,7 +11,9 @@ def check_future_import(node):
return set()
node = node.children[0]
# now node is the import_from node
- if not (node.type == syms.import_from and node.children[1].value == u'__future__'):
+ if not (node.type == syms.import_from and
+ node.type == token.NAME and
+ node.children[1].value == u'__future__'):
return set()
node = node.children[3]
# now node is the import_as_name[s]
Please sign in to comment.
Something went wrong with that request. Please try again.