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.
........
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 4992a32..ed48379 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -474,6 +474,12 @@
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