We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5bb0bf commit 7bad39fCopy full SHA for 7bad39f
Lib/threading.py
@@ -1059,10 +1059,10 @@ def join(self, timeout=None):
1059
1060
if timeout is None:
1061
self._wait_for_tstate_lock()
1062
- elif timeout >= 0:
1063
- self._wait_for_tstate_lock(timeout=timeout)
1064
- # else it's a negative timeout - precise behavior isn't documented
1065
- # then, but historically .join() returned in this case
+ else:
+ # the behavior of a negative timeout isn't documented, but
+ # historically .join() has acted as if timeout=0 then
+ self._wait_for_tstate_lock(timeout=max(timeout, 0))
1066
1067
def _wait_for_tstate_lock(self, block=True, timeout=-1):
1068
# Issue #18808: wait for the thread state to be gone.
0 commit comments