diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-17 13:32:52 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-10-17 13:32:52 (GMT) |
commit | d114261608f986b5c797eef4330fbe32041d3eb6 (patch) | |
tree | 5b704954e5043689f54f1ed2dcfd1a4302ceebc2 /Lib | |
parent | 771f9146d5c29f8c059ebaad42ce49472ed48e0c (diff) | |
download | cpython-d114261608f986b5c797eef4330fbe32041d3eb6.zip cpython-d114261608f986b5c797eef4330fbe32041d3eb6.tar.gz cpython-d114261608f986b5c797eef4330fbe32041d3eb6.tar.bz2 |
Handle testlist_safe as if it were testlist.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/compiler/transformer.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index c2a3b96..88b3dac 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -515,9 +515,11 @@ class Transformer: def testlist(self, nodelist): # testlist: expr (',' expr)* [','] + # testlist_safe: test [(',' test)+ [',']] # exprlist: expr (',' expr)* [','] return self.com_binary(Tuple, nodelist) + testlist_safe = testlist # XXX exprlist = testlist def test(self, nodelist): @@ -1254,6 +1256,7 @@ class Transformer: _doc_nodes = [ symbol.expr_stmt, symbol.testlist, + symbol.testlist_safe, symbol.test, symbol.and_test, symbol.not_test, @@ -1306,6 +1309,7 @@ _legal_node_types = [ symbol.try_stmt, symbol.suite, symbol.testlist, + symbol.testlist_safe, symbol.test, symbol.and_test, symbol.not_test, |