1 | n/a | """Remove __future__ imports |
---|
2 | n/a | |
---|
3 | n/a | from __future__ import foo is replaced with an empty line. |
---|
4 | n/a | """ |
---|
5 | n/a | # Author: Christian Heimes |
---|
6 | n/a | |
---|
7 | n/a | # Local imports |
---|
8 | n/a | from .. import fixer_base |
---|
9 | n/a | from ..fixer_util import BlankLine |
---|
10 | n/a | |
---|
11 | n/a | class FixFuture(fixer_base.BaseFix): |
---|
12 | n/a | BM_compatible = True |
---|
13 | n/a | |
---|
14 | n/a | PATTERN = """import_from< 'from' module_name="__future__" 'import' any >""" |
---|
15 | n/a | |
---|
16 | n/a | # This should be run last -- some things check for the import |
---|
17 | n/a | run_order = 10 |
---|
18 | n/a | |
---|
19 | n/a | def transform(self, node, results): |
---|
20 | n/a | new = BlankLine() |
---|
21 | n/a | new.prefix = node.prefix |
---|
22 | n/a | return new |
---|