summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_threading.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index fe076b134f..054df7ba69 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -227,14 +227,10 @@ class ThreadTests(unittest.TestCase):
threading._start_new_thread = fail_new_thread
try:
t = threading.Thread(target=lambda: None)
- try:
- t.start()
- assert False
- except thread.error:
- self.assertFalse(
- t in threading._limbo,
- "Failed to cleanup _limbo map on failure of Thread.start()."
- )
+ self.assertRaises(thread.error, t.start)
+ self.assertFalse(
+ t in threading._limbo,
+ "Failed to cleanup _limbo map on failure of Thread.start().")
finally:
threading._start_new_thread = _start_new_thread