]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_input.py
1 """Fixer that changes input(...) into eval(input(...))."""
2 # Author: Andre Roberge
5 from .. import fixer_base
6 from ..fixer_util
import Call
, Name
10 context
= patcomp
.compile_pattern("power< 'eval' trailer< '(' any ')' > >")
13 class FixInput(fixer_base
.BaseFix
):
16 power< 'input' args=trailer< '(' [any] ')' > >
19 def transform(self
, node
, results
):
20 # If we're already wrapped in a eval() call, we're done.
21 if context
.match(node
.parent
.parent
):
26 return Call(Name(u
"eval"), [new
], prefix
=node
.prefix
)