]> granicus.if.org Git - python/commitdiff
Issue #19399: fix sporadic test_subprocess failure.
authorTim Peters <tim@python.org>
Sat, 26 Oct 2013 01:46:51 +0000 (20:46 -0500)
committerTim Peters <tim@python.org>
Sat, 26 Oct 2013 01:46:51 +0000 (20:46 -0500)
Change Thread.join() with a negative timeout to just return.  The
behavior isn't documented then, but this restores previous
behavior.

Lib/threading.py
Misc/NEWS

index 185c980ce0dafa9beaa744d6afd2a473b3abbc19..0c92ab10d09f2f328c10ba02498414887c1bdb32 100644 (file)
@@ -1056,10 +1056,13 @@ class Thread:
             raise RuntimeError("cannot join thread before it is started")
         if self is current_thread():
             raise RuntimeError("cannot join current thread")
+
         if timeout is None:
             self._wait_for_tstate_lock()
-        else:
+        elif timeout >= 0:
             self._wait_for_tstate_lock(timeout=timeout)
+        # else it's a negative timeout - precise behavior isn't documented
+        # then, but historically .join() returned in this case
 
     def _wait_for_tstate_lock(self, block=True, timeout=-1):
         # Issue #18808: wait for the thread state to be gone.
index a083cc3a3fe1938f7710038e05cd64d072d046e4..e7899fdc473bc4cc70b24bd76c944ca4c9d8e12e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #19399: fix sporadic test_subprocess failure.
+
 - Issue #13234: Fix os.listdir to work with extended paths on Windows.
   Patch by Santoso Wijaya.