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.
end_offset
1 parent bc262de commit e8f4e27Copy full SHA for e8f4e27
1 file changed
Lib/test/test_exceptions.py
@@ -2274,6 +2274,21 @@ def test_range_of_offsets(self):
2274
self.assertIn(expected, err.getvalue())
2275
the_exception = exc
2276
2277
+ def test_subclass(self):
2278
+ class MySyntaxError(SyntaxError):
2279
+ pass
2280
+
2281
+ try:
2282
+ raise MySyntaxError("bad bad", ("bad.py", 1, 2, "abcdefg", 1, 7))
2283
+ except SyntaxError as exc:
2284
+ with support.captured_stderr() as err:
2285
+ sys.__excepthook__(*sys.exc_info())
2286
+ self.assertIn("""
2287
+ File "bad.py", line 1
2288
+ abcdefg
2289
+ ^^^^^
2290
+""", err.getvalue())
2291
2292
def test_encodings(self):
2293
self.addCleanup(unlink, TESTFN)
2294
source = (
0 commit comments