mirror of https://github.com/python/cpython
Issue #19399: fix sporadic test_subprocess failure.
Change Thread.join() with a negative timeout to just return. The behavior isn't documented then, but this restores previous behavior.
This commit is contained in:
parent
bdb61387b7
commit
e5bb0bf04d
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue