fix_printfunction.py 401 B

1234567891011121314151617
  1. u"""
  2. Fixer for print: from __future__ import print_function.
  3. """
  4. from lib2to3 import fixer_base
  5. from libfuturize.fixer_util import future_import
  6. class FixPrintfunction(fixer_base.BaseFix):
  7. # explicit = True
  8. PATTERN = u"""
  9. power< 'print' trailer < '(' any* ')' > any* >
  10. """
  11. def transform(self, node, results):
  12. future_import(u"print_function", node)