diff options
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r-- | Lib/test/test_ast.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 413613f24b..a8853c7e21 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -411,7 +411,9 @@ class ASTHelpers_Test(unittest.TestCase): try: 1/0 except Exception: - self.assertRaises(SyntaxError, ast.parse, r"'\U'") + with self.assertRaises(SyntaxError) as e: + ast.literal_eval(r"'\U'") + self.assertIsNotNone(e.exception.__context__) def test_dump(self): node = ast.parse('spam(eggs, "and cheese")') |