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.
........
This commit is contained in:
Amaury Forgeot d'Arc 2010-08-19 21:50:08 +00:00
parent 3478ac066b
commit b1147f5d0a
2 changed files with 26 additions and 26 deletions

View file

@ -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