ยปCore Development>Code coverage>Lib/lib2to3/fixes/fix_future.py

Python code coverage for Lib/lib2to3/fixes/fix_future.py

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