Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 3a2d18b7d7af0bc395b2c76c009be2f2435556be authored by Larry Hastings on 07 September 2013, 11:42:07 UTC
Version number bump for Python 3.4.0a2.
Tip revision: 3a2d18b
fix_raw_input.py
"""Fixer that changes raw_input(...) into input(...)."""
# Author: Andre Roberge

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixRawInput(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("input", prefix=name.prefix))
back to top