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

Philip Jenvey pjenvey at underboss.org
Mon Mar 25 01:02:42 CET 2013


On Fri, Mar 22, 2013 at 10:04 AM, frank.wierzbicki <
jython-checkins at python.org> wrote:

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

I think self.__flag should be assigned to a local variable because it may
have changed since the initial check.

--
Philip Jenvey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/jython-checkins/attachments/20130324/3be5aac5/attachment.html>


More information about the Jython-checkins mailing list