mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Fix the formatting of KeyboardInterrupt -- a bad issubclass() call.
This commit is contained in:
parent
a883701dff
commit
8f6cbe1502
2 changed files with 7 additions and 1 deletions
|
|
@ -103,6 +103,12 @@ def test():
|
|||
import sys
|
||||
sys.exc_traceback.__members__
|
||||
|
||||
def test_base_exception(self):
|
||||
# Test that exceptions derived from BaseException are formatted right
|
||||
e = KeyboardInterrupt()
|
||||
lst = traceback.format_exception_only(e.__class__, e)
|
||||
self.assertEqual(lst, ['KeyboardInterrupt\n'])
|
||||
|
||||
def test_main():
|
||||
run_unittest(TracebackCases)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue