Skip to content

Commit 09041b1

Browse files
committed
Make __future__ import check more robust
1 parent a8c69fd commit 09041b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libmodernize/fixes/fix_import.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def transform(self, node, results):
1515
if self.skip:
1616
return
1717
# We're not interested in __future__ imports here
18-
if node.type == syms.import_from and results['imp'].value == '__future__':
18+
if node.type == syms.import_from \
19+
and getattr(results['imp'], 'value', None) == '__future__':
1920
return
2021

2122
# If there are any non-future imports, add absolute_import

0 commit comments

Comments
 (0)