summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2010-08-19 21:50:08 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2010-08-19 21:50:08 +0000
commitb1147f5d0a89a24a978d9db93750ad5cc3829542 (patch)
tree5c80e35204bbb87eefec882467a95645c4501c11 /Lib/test/test_syntax.py
parent3478ac066b1d5367b5f818df7aa65a1a16912755 (diff)
downloadcpython-git-b1147f5d0a89a24a978d9db93750ad5cc3829542.tar.gz
Merged revisions 84209, 84214 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84209 | amaury.forgeotdarc | 2010-08-19 19:43:15 +0200 (jeu., 19 août 2010) | 5 lines Check the return values for all functions returning an ast node. Failure to do it may result in strange error messages or even crashes, in admittedly convoluted cases that are normally syntax errors, like: def f(*xx, __debug__): pass ........ r84214 | amaury.forgeotdarc | 2010-08-19 23:32:38 +0200 (jeu., 19 août 2010) | 3 lines Add tests for r84209 (crashes in the Ast builder) Also remove one tab, and move a check closer to the possible failure. ........
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 4992a32a8e..ed48379d6b 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -474,6 +474,12 @@ Traceback (most recent call last):
File "<doctest test.test_syntax[50]>", line 1
SyntaxError: can't assign to literal
+Corner-case that used to crash:
+
+ >>> def f(*xx, **__debug__): pass
+ Traceback (most recent call last):
+ SyntaxError: cannot assign to __debug__
+
"""
import re