]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Cleanup the test added in r78517 based on Ezio Melotti's feedback.
authorGregory P. Smith <greg@mad-scientist.com>
Mon, 1 Mar 2010 03:09:19 +0000 (03:09 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Mon, 1 Mar 2010 03:09:19 +0000 (03:09 +0000)
Lib/test/test_threading.py

index defa9ee0f9ada84c71228059649971d767f3abe3..70dd026a90c97df15f36cbb666faf598a016aed6 100644 (file)
@@ -257,14 +257,10 @@ class ThreadTests(BaseTestCase):
         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