We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1f648e commit 8660604Copy full SHA for 8660604
Lib/test/test_traceback.py
@@ -1477,6 +1477,21 @@ def __str__(self):
1477
exp = "%s: %s\n" % (str_name, str_value)
1478
self.assertEqual(exp, err)
1479
1480
+ def test_exception_angle_bracketed_filename(self):
1481
+ src = textwrap.dedent("""
1482
+ try:
1483
+ raise ValueError(42)
1484
+ except Exception as e:
1485
+ exc = e
1486
+ """)
1487
+
1488
+ code = compile(src, "<does not exist>", "exec")
1489
+ g, l = {}, {}
1490
+ exec(code, g, l)
1491
+ err = self.get_report(l['exc'])
1492
+ exp = ' File "<does not exist>", line 3, in <module>\nValueError: 42\n'
1493
+ self.assertIn(exp, err)
1494
1495
def test_exception_modulename_not_unicode(self):
1496
class X(Exception):
1497
def __str__(self):
0 commit comments