diff options
Diffstat (limited to 'Lib/lib2to3/fixes/fix_raw_input.py')
-rw-r--r-- | Lib/lib2to3/fixes/fix_raw_input.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/lib2to3/fixes/fix_raw_input.py b/Lib/lib2to3/fixes/fix_raw_input.py new file mode 100644 index 0000000..ba045d6 --- /dev/null +++ b/Lib/lib2to3/fixes/fix_raw_input.py @@ -0,0 +1,16 @@ +"""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): + + PATTERN = """ + power< name='raw_input' trailer< '(' [any] ')' > any* > + """ + + def transform(self, node, results): + name = results["name"] + name.replace(Name(u"input", prefix=name.prefix)) |