home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Bureautique / OpenOffice / Apache_OpenOffice_4.1.1_Win_x86_install_fr.exe / openoffice1.cab / fix_future.py < prev    next >
Text File  |  2014-07-29  |  547b  |  23 lines

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