diff options
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 185c980ce0..0c92ab10d0 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -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. |