Permalink
Browse files

Properly check for from __future__ import.

  • Loading branch information...
1 parent 0db885e commit 522971f0a688020c05fa84f1762b3cabf96cb73b @loewis loewis committed Mar 13, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 libmodernize/__init__.py
View
@@ -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]

0 comments on commit 522971f

Please sign in to comment.