diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2010-08-19 22:29:49 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2010-08-19 22:29:49 (GMT) |
commit | 72356338cb60198d45ebf6737bdc173088c38a17 (patch) | |
tree | c9954872cd7288d24e15253e549e09d4eb4b878e /Lib/test/test_syntax.py | |
parent | a1e5c69d5bc50b57ac10a27c77a6016947919abd (diff) | |
download | cpython-72356338cb60198d45ebf6737bdc173088c38a17.zip cpython-72356338cb60198d45ebf6737bdc173088c38a17.tar.gz cpython-72356338cb60198d45ebf6737bdc173088c38a17.tar.bz2 |
The 3.1 compiler don't check for keyword assignments in all places.
Find another way to generate a SyntaxError in the tests.
Previously, these statements would raise something strange like
TypeError: "'int' object is not iterable"
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index be783c7..2afbb61 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -478,32 +478,22 @@ SyntaxError: keyword argument repeated Corner-cases that used to fail to raise the correct error: - >>> def f(*, x=lambda __debug__:0): pass + >>> def f(*, x=lambda *:0): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: named arguments must follow bare * - >>> def f(*args:(lambda __debug__:0)): pass + >>> def f(*args:(lambda *:0)): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: named arguments must follow bare * - >>> def f(**kwargs:(lambda __debug__:0)): pass + >>> def f(**kwargs:(lambda *:0)): pass Traceback (most recent call last): - SyntaxError: assignment to keyword + SyntaxError: named arguments must follow bare * >>> with (lambda *:0): pass Traceback (most recent call last): SyntaxError: named arguments must follow bare * -Corner-cases that used to crash: - - >>> def f(**__debug__): pass - Traceback (most recent call last): - SyntaxError: assignment to keyword - - >>> def f(*xx, __debug__): pass - Traceback (most recent call last): - SyntaxError: assignment to keyword - """ import re |