mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Import lib2to3.
This commit is contained in:
parent
a4d77898db
commit
5e37baea80
68 changed files with 11993 additions and 0 deletions
16
Lib/lib2to3/fixes/fix_raw_input.py
Normal file
16
Lib/lib2to3/fixes/fix_raw_input.py
Normal file
|
|
@ -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()))
|
||||
Loading…
Add table
Add a link
Reference in a new issue