diff options
author | Georg Brandl <georg@python.org> | 2010-10-28 09:03:20 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-10-28 09:03:20 +0000 |
commit | 5c5983c98878f5fe8494047df8c0eda787c02202 (patch) | |
tree | 1c0f10dfdf4b70aaef4a5e7201a838765268cd1d /Lib/threading.py | |
parent | 76b25ac6aaa2ad8f2fce29182d19fe5b8851293d (diff) | |
download | cpython-5c5983c98878f5fe8494047df8c0eda787c02202.tar.gz |
#10218: return timeout status from Condition.wait, mirroring other primitives' behavior.
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index dd6e91d37b..238a5c4508 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -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) |