mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Cause calling interrupt_main in main thread raise KeyboardInterrupt instantly.
This commit is contained in:
parent
4e64d78bbb
commit
91012fe9b5
2 changed files with 17 additions and 4 deletions
|
|
@ -109,6 +109,11 @@ class MiscTests(unittest.TestCase):
|
|||
_thread.interrupt_main()
|
||||
self.failUnlessRaises(KeyboardInterrupt, _thread.start_new_thread,
|
||||
call_interrupt, tuple())
|
||||
|
||||
def test_interrupt_in_main(self):
|
||||
# Make sure that if interrupt_main is called in main threat that
|
||||
# KeyboardInterrupt is raised instantly.
|
||||
self.failUnlessRaises(KeyboardInterrupt, _thread.interrupt_main)
|
||||
|
||||
class ThreadTests(unittest.TestCase):
|
||||
"""Test thread creation."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue