mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Revert "closes bpo-27494: Fix 2to3 handling of trailing comma after a generator expression (GH-3771)" (#8241)
This reverts commit af810b35b4
.
This is not valid syntax (see bpo-32012).
This commit is contained in:
parent
ac20e0f98d
commit
4b8a7f51da
7 changed files with 12 additions and 36 deletions
|
@ -101,8 +101,8 @@ def ListComp(xp, fp, it, test=None):
|
|||
test.prefix = " "
|
||||
if_leaf = Leaf(token.NAME, "if")
|
||||
if_leaf.prefix = " "
|
||||
inner_args.append(Node(syms.old_comp_if, [if_leaf, test]))
|
||||
inner = Node(syms.listmaker, [xp, Node(syms.old_comp_for, inner_args)])
|
||||
inner_args.append(Node(syms.comp_if, [if_leaf, test]))
|
||||
inner = Node(syms.listmaker, [xp, Node(syms.comp_for, inner_args)])
|
||||
return Node(syms.atom,
|
||||
[Leaf(token.LBRACE, "["),
|
||||
inner,
|
||||
|
@ -208,7 +208,7 @@ def attr_chain(obj, attr):
|
|||
next = getattr(next, attr)
|
||||
|
||||
p0 = """for_stmt< 'for' any 'in' node=any ':' any* >
|
||||
| old_comp_for< 'for' any 'in' node=any any* >
|
||||
| comp_for< 'for' any 'in' node=any any* >
|
||||
"""
|
||||
p1 = """
|
||||
power<
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue