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