diff options
author | Brett Cannon <bcannon@gmail.com> | 2003-06-13 23:56:32 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2003-06-13 23:56:32 (GMT) |
commit | 91012fe9b58b9dff2298aad453804023d557447b (patch) | |
tree | 28c6a48ff21d97783760a06eee1e1db62e2b21fe /Lib/test/test_dummy_thread.py | |
parent | 4e64d78bbb961672ee324db234c70320ed4db6d5 (diff) | |
download | cpython-91012fe9b58b9dff2298aad453804023d557447b.zip cpython-91012fe9b58b9dff2298aad453804023d557447b.tar.gz cpython-91012fe9b58b9dff2298aad453804023d557447b.tar.bz2 |
Cause calling interrupt_main in main thread raise KeyboardInterrupt instantly.
Diffstat (limited to 'Lib/test/test_dummy_thread.py')
-rw-r--r-- | Lib/test/test_dummy_thread.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_dummy_thread.py b/Lib/test/test_dummy_thread.py index d437cb1..3e79f8d 100644 --- a/Lib/test/test_dummy_thread.py +++ b/Lib/test/test_dummy_thread.py @@ -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.""" |