mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
#10218: return timeout status from Condition.wait, mirroring other primitives' behavior.
This commit is contained in:
parent
cbb9421347
commit
b9a4391754
4 changed files with 29 additions and 13 deletions
|
@ -232,6 +232,7 @@ class _Condition(_Verbose):
|
|||
try: # restore state no matter what (e.g., KeyboardInterrupt)
|
||||
if timeout is None:
|
||||
waiter.acquire()
|
||||
gotit = True
|
||||
if __debug__:
|
||||
self._note("%s.wait(): got it", self)
|
||||
else:
|
||||
|
@ -249,6 +250,7 @@ class _Condition(_Verbose):
|
|||
else:
|
||||
if __debug__:
|
||||
self._note("%s.wait(%s): got it", self, timeout)
|
||||
return gotit
|
||||
finally:
|
||||
self._acquire_restore(saved_state)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue