[Jython-checkins] jython: #2005 threading.Event.wait(timeout) returns boolean. Thanks Santoso Wijaya!

frank.wierzbicki jython-checkins at python.org
Fri Mar 22 18:04:06 CET 2013


http://hg.python.org/jython/rev/0d7595c0dafe
changeset:   7096:0d7595c0dafe
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Fri Mar 22 10:03:57 2013 -0700
summary:
  #2005 threading.Event.wait(timeout) returns boolean. Thanks Santoso Wijaya!

files:
  ACKNOWLEDGMENTS  |  1 +
  Lib/threading.py |  3 +++
  NEWS             |  1 +
  3 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/ACKNOWLEDGMENTS b/ACKNOWLEDGMENTS
--- a/ACKNOWLEDGMENTS
+++ b/ACKNOWLEDGMENTS
@@ -102,6 +102,7 @@
     Andreas Stührk
     Christian Klein
     Jezreel Ng
+    Santoso Wijaya
 
 Local Variables:
 mode: indented-text
diff --git a/Lib/threading.py b/Lib/threading.py
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -416,5 +416,8 @@
         try:
             if not self.__flag:
                 self.__cond.wait(timeout)
+            # Issue 2005: Since CPython 2.7, threading.Event.wait(timeout) returns boolean.
+            # The function should return False if timeout is reached before the event is set.
+            return self.__flag
         finally:
             self.__cond.release()
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@
 
 Jython 2.7b2
   Bugs Fixed
+    - [ 2005 ] threading.Event object's wait([timeout]) function returns null instead of True/False.
     - [ 1926 ] Adjust MutableSet.pop test so we do not need to skip it
     - [ 2020 ] str.translate should delete characters in the second arg when table is None
     - [ 1753 ] zlib doesn't call end() on compress and decompress

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list