[Python-Dev] [Python-checkins] cpython: Fix potential NameError in multiprocessing.Condition.wait()

Eli Bendersky eliben at gmail.com
Tue Jun 5 07:59:37 CEST 2012


Can you add a testcase for this?

On Mon, Jun 4, 2012 at 9:01 PM, richard.oudkerk
<python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/3baeb5e13dd2
> changeset:   77348:3baeb5e13dd2
> user:        Richard Oudkerk <shibturn at gmail.com>
> date:        Mon Jun 04 18:59:07 2012 +0100
> summary:
>  Fix potential NameError in multiprocessing.Condition.wait()
>
> files:
>  Lib/multiprocessing/synchronize.py |  3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
>
> diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py
> --- a/Lib/multiprocessing/synchronize.py
> +++ b/Lib/multiprocessing/synchronize.py
> @@ -216,7 +216,7 @@
>
>         try:
>             # wait for notification or timeout
> -            ret = self._wait_semaphore.acquire(True, timeout)
> +            return self._wait_semaphore.acquire(True, timeout)
>         finally:
>             # indicate that this thread has woken
>             self._woken_count.release()
> @@ -224,7 +224,6 @@
>             # reacquire lock
>             for i in range(count):
>                 self._lock.acquire()
> -            return ret
>
>     def notify(self):
>         assert self._lock._semlock._is_mine(), 'lock is not owned'
>
> --
> Repository URL: http://hg.python.org/cpython
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-Dev mailing list