mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Handle testlist_safe and or_test like testlist.
This commit is contained in:
parent
49a1302952
commit
16c7f71380
1 changed files with 2 additions and 2 deletions
|
@ -945,7 +945,7 @@ class Transformer:
|
||||||
# loop to avoid trivial recursion
|
# loop to avoid trivial recursion
|
||||||
while 1:
|
while 1:
|
||||||
t = node[0]
|
t = node[0]
|
||||||
if t == symbol.exprlist or t == symbol.testlist or t == symbol.testlist_gexp:
|
if t in (symbol.exprlist, symbol.testlist, symbol.testlist_safe, symbol.or_test, symbol.testlist_gexp):
|
||||||
if len(node) > 2:
|
if len(node) > 2:
|
||||||
return self.com_assign_tuple(node, assigning)
|
return self.com_assign_tuple(node, assigning)
|
||||||
node = node[1]
|
node = node[1]
|
||||||
|
@ -982,7 +982,7 @@ class Transformer:
|
||||||
else:
|
else:
|
||||||
raise SyntaxError, "can't assign to literal"
|
raise SyntaxError, "can't assign to literal"
|
||||||
else:
|
else:
|
||||||
raise SyntaxError, "bad assignment"
|
raise SyntaxError, "bad assignment (%s)" % t
|
||||||
|
|
||||||
def com_assign_tuple(self, node, assigning):
|
def com_assign_tuple(self, node, assigning):
|
||||||
assigns = []
|
assigns = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue