diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-03-05 01:50:33 +0000 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-03-05 01:50:33 +0000 |
commit | d21fb4c2e097dd72d1772a6f0325cc45f9b20f30 (patch) | |
tree | 3a41c2f003bd75ac8855abcab177010dc7577760 /Lib/test/test_grammar.py | |
parent | 3710a135067f72322d07df4f5916bcec61ae25d5 (diff) | |
download | cpython-git-d21fb4c2e097dd72d1772a6f0325cc45f9b20f30.tar.gz |
Issue#2238: some syntax errors from *args or **kwargs expressions
would give bogus error messages, because of untested exceptions::
>>> f(**g(1=2))
XXX undetected error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
instead of the expected SyntaxError: keyword can't be an expression
Will backport.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index e2bb3eb9e6..0e593677fd 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -282,6 +282,10 @@ class GrammarTests(unittest.TestCase): def d32v((x,)): pass d32v((1,)) + # Check ast errors in *args and *kwargs + check_syntax_error(self, "f(*g(1=2))") + check_syntax_error(self, "f(**g(1=2))") + def testLambdef(self): ### lambdef: 'lambda' [varargslist] ':' test l1 = lambda : 0 |