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..e746255 --- /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 basefix +from .util import Name + +class FixRawInput(basefix.BaseFix): + + PATTERN = """ + power< name='raw_input' trailer< '(' [any] ')' > > + """ + + def transform(self, node, results): + name = results["name"] + name.replace(Name("input", prefix=name.get_prefix())) |