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

2012年6月04日 23:01:57 -0700

Can you add a testcase for this?
On Mon, Jun 4, 2012 at 9:01 PM, richard.oudkerk
<[email protected]> wrote:
> http://hg.python.org/cpython/rev/3baeb5e13dd2
> changeset:  77348:3baeb5e13dd2
> user:    Richard Oudkerk <[email protected]>
> 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
> [email protected]
> http://mail.python.org/mailman/listinfo/python-checkins
>
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to