#10218: return timeout status from Condition.wait, mirroring other primitives' behavior.

This commit is contained in:
Georg Brandl 2010-10-28 09:03:20 +00:00
parent cbb9421347
commit b9a4391754
4 changed files with 29 additions and 13 deletions

View file

@ -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)