diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-09-02 18:23:15 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-09-02 18:23:15 (GMT) |
commit | 2e2c903700991aa9f7e96d7a7fdaed3628dc7e1e (patch) | |
tree | e83f41d8848df305fc725ed1b5c7ebf6ba55c17e /Lib | |
parent | 1c371b255ff15971f2aac1f1ff4a248718744af3 (diff) | |
download | cpython-2e2c903700991aa9f7e96d7a7fdaed3628dc7e1e.zip cpython-2e2c903700991aa9f7e96d7a7fdaed3628dc7e1e.tar.gz cpython-2e2c903700991aa9f7e96d7a7fdaed3628dc7e1e.tar.bz2 |
prevert ast errors from being normalized before ast_error_finish is called (closes #15846)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_ast.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index e22d4de..2887092 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -386,6 +386,12 @@ class ASTHelpers_Test(unittest.TestCase): b = compile('foo(1 + 1)', '<unknown>', 'exec', ast.PyCF_ONLY_AST) self.assertEqual(ast.dump(a), ast.dump(b)) + def test_parse_in_error(self): + try: + 1/0 + except Exception: + self.assertRaises(SyntaxError, ast.parse, r"'\U'") + def test_dump(self): node = ast.parse('spam(eggs, "and cheese")') self.assertEqual(ast.dump(node), |