Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9f72db commit bd0df50Copy full SHA for bd0df50
2 files changed
Lib/test/test_ast.py
@@ -411,7 +411,9 @@ def test_parse_in_error(self):
411
try:
412
1/0
413
except Exception:
414
- self.assertRaises(SyntaxError, ast.parse, r"'\U'")
+ with self.assertRaises(SyntaxError) as e:
415
+ ast.literal_eval(r"'\U'")
416
+ self.assertIsNotNone(e.exception.__context__)
417
418
def test_dump(self):
419
node = ast.parse('spam(eggs, "and cheese")')
0 commit comments