[Python-checkins] cpython (2.7): LOL - 2.7 requires very different code. Annoying ;-)

tim.peters python-checkins at python.org
Wed Oct 9 04:53:26 CEST 2013


http://hg.python.org/cpython/rev/3f7a2a3cf5c9
changeset:   86169:3f7a2a3cf5c9
branch:      2.7
parent:      86167:cb4fd7515cb4
user:        Tim Peters <tim at python.org>
date:        Tue Oct 08 21:51:06 2013 -0500
summary:
  LOL - 2.7 requires very different code.  Annoying ;-)

files:
  Lib/threading.py |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Lib/threading.py b/Lib/threading.py
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -531,11 +531,11 @@
         raise a ValueError.
 
         """
-        with self._cond:
-            if self._value >= self._initial_value:
+        with self._Semaphore__cond:
+            if self._Semaphore__value >= self._initial_value:
                 raise ValueError("Semaphore released too many times")
-            self._value += 1
-            self._cond.notify()
+            self._Semaphore__value += 1
+            self._Semaphore__cond.notify()
 
 
 def Event(*args, **kwargs):

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


More information about the Python-checkins mailing list