Commits

Mike Bayer committed 57c06c6

notify_all workaround for 2.5

Comments (0)

Files changed (2)

lib/sqlalchemy/util/queue.py

 from collections import deque
 from time import time as _time
 from sqlalchemy.util import threading
+import sys
+
+if sys.version_info < (2, 6):
+    def notify_all(condition):
+        condition.notify()
+else:
+    def notify_all(condition):
+        condition.notify_all()
 
 __all__ = ['Empty', 'Full', 'Queue', 'SAAbort']
 
+
 class Empty(Exception):
     "Exception raised by Queue.get(block=0)/get_nowait()."
 
         if not self.not_full.acquire(False):
             return
         try:
-            self.not_empty.notify_all()
+            notify_all(self.not_empty)
         finally:
             self.not_full.release()
 

test/engine/test_pool.py

         time.sleep(1)
         eq_(len(success), 12)
 
+    @testing.requires.python26
     def test_notify_waiters(self):
         dbapi = MockDBAPI()
         canary = []