PageRenderTime 222ms CodeModel.GetById 121ms app.highlight 1ms RepoModel.GetById 99ms app.codeStats 0ms

/Lib/lib2to3/fixes/fix_future.py

http://unladen-swallow.googlecode.com/
Python | 20 lines | 12 code | 2 blank | 6 comment | 0 complexity | 0e2786c94aac6b11a47d8ec46d8b19d6 MD5 | raw file
 1"""Remove __future__ imports
 2
 3from __future__ import foo is replaced with an empty line.
 4"""
 5# Author: Christian Heimes
 6
 7# Local imports
 8from .. import fixer_base
 9from ..fixer_util import BlankLine
10
11class FixFuture(fixer_base.BaseFix):
12    PATTERN = """import_from< 'from' module_name="__future__" 'import' any >"""
13
14    # This should be run last -- some things check for the import
15    run_order = 10
16
17    def transform(self, node, results):
18        new = BlankLine()
19        new.prefix = node.get_prefix()
20        return new