fix_raw_input.py 454 B

1234567891011121314151617
  1. """Fixer that changes raw_input(...) into input(...)."""
  2. # Author: Andre Roberge
  3. # Local imports
  4. from .. import fixer_base
  5. from ..fixer_util import Name
  6. class FixRawInput(fixer_base.BaseFix):
  7. BM_compatible = True
  8. PATTERN = """
  9. power< name='raw_input' trailer< '(' [any] ')' > any* >
  10. """
  11. def transform(self, node, results):
  12. name = results["name"]
  13. name.replace(Name("input", prefix=name.prefix))