summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/fixes
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2017-10-05 07:10:09 (GMT)
committerBenjamin Peterson <benjamin@python.org>2017-10-05 07:10:09 (GMT)
commitaf810b35b494ef1d255d4bf340b92a9dad446995 (patch)
tree78df02ecf9d934a174aa2ad1202d583b29faeba7 /Lib/lib2to3/fixes
parenta8ed11742b4c2115597977ce04fa8e043d9e0792 (diff)
downloadcpython-af810b35b494ef1d255d4bf340b92a9dad446995.zip
cpython-af810b35b494ef1d255d4bf340b92a9dad446995.tar.gz
cpython-af810b35b494ef1d255d4bf340b92a9dad446995.tar.bz2
closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (#3771)
Diffstat (limited to 'Lib/lib2to3/fixes')
-rw-r--r--Lib/lib2to3/fixes/fix_dict.py2
-rw-r--r--Lib/lib2to3/fixes/fix_paren.py4
-rw-r--r--Lib/lib2to3/fixes/fix_xrange.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/Lib/lib2to3/fixes/fix_dict.py b/Lib/lib2to3/fixes/fix_dict.py
index d3655c9..55be553 100644
--- a/Lib/lib2to3/fixes/fix_dict.py
+++ b/Lib/lib2to3/fixes/fix_dict.py
@@ -83,7 +83,7 @@ class FixDict(fixer_base.BaseFix):
p1 = patcomp.compile_pattern(P1)
P2 = """for_stmt< 'for' any 'in' node=any ':' any* >
- | comp_for< 'for' any 'in' node=any any* >
+ | old_comp_for< 'for' any 'in' node=any any* >
"""
p2 = patcomp.compile_pattern(P2)
diff --git a/Lib/lib2to3/fixes/fix_paren.py b/Lib/lib2to3/fixes/fix_paren.py
index b205aa7..de49eef 100644
--- a/Lib/lib2to3/fixes/fix_paren.py
+++ b/Lib/lib2to3/fixes/fix_paren.py
@@ -15,7 +15,7 @@ class FixParen(fixer_base.BaseFix):
PATTERN = """
atom< ('[' | '(')
(listmaker< any
- comp_for<
+ old_comp_for<
'for' NAME 'in'
target=testlist_safe< any (',' any)+ [',']
>
@@ -24,7 +24,7 @@ class FixParen(fixer_base.BaseFix):
>
|
testlist_gexp< any
- comp_for<
+ old_comp_for<
'for' NAME 'in'
target=testlist_safe< any (',' any)+ [',']
>
diff --git a/Lib/lib2to3/fixes/fix_xrange.py b/Lib/lib2to3/fixes/fix_xrange.py
index 1e491e1..f5f06f3 100644
--- a/Lib/lib2to3/fixes/fix_xrange.py
+++ b/Lib/lib2to3/fixes/fix_xrange.py
@@ -55,7 +55,7 @@ class FixXrange(fixer_base.BaseFix):
p1 = patcomp.compile_pattern(P1)
P2 = """for_stmt< 'for' any 'in' node=any ':' any* >
- | comp_for< 'for' any 'in' node=any any* >
+ | old_comp_for< 'for' any 'in' node=any any* >
| comparison< any 'in' node=any any*>
"""
p2 = patcomp.compile_pattern(P2)