diff options
| author | Benjamin Peterson <benjamin@python.org> | 2010-11-20 01:48:38 +0000 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2010-11-20 01:48:38 +0000 |
| commit | aab9585130d1143f2b734ba67d0676fd874040d8 (patch) | |
| tree | 9c40c21af0d2b0f41be2c1fdda8efdb5ea1e3d44 /Lib/test/test_ast.py | |
| parent | c9a9417f487beeddbf0af4e253fab3c1545207f4 (diff) | |
| download | cpython-git-aab9585130d1143f2b734ba67d0676fd874040d8.tar.gz | |
Merged revisions 86538 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86538 | benjamin.peterson | 2010-11-19 19:38:49 -0600 (Fri, 19 Nov 2010) | 1 line
use %R format code; fixes invalid dereferencing #10391
........
Diffstat (limited to 'Lib/test/test_ast.py')
| -rw-r--r-- | Lib/test/test_ast.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 7ee16bf5bd..01c4ba38ca 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -183,6 +183,16 @@ class AST_Tests(unittest.TestCase): ast2 = mod.loads(mod.dumps(ast, protocol)) self.assertEquals(to_tuple(ast2), to_tuple(ast)) + def test_invalid_sum(self): + pos = dict(lineno=2, col_offset=3) + m = ast.Module([ast.Expr(ast.expr(**pos), **pos)]) + try: + compile(m, "<test>", "exec") + except TypeError as exc: + self.assertIn("but got <_ast.expr", str(exc)) + else: + self.fail("needed TypeError") + class ASTHelpers_Test(unittest.TestCase): |
