Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit ea4f31d

Browse files
committed
Added 2.4 compatability by adding a workaround for the missing deque.remove method
1 parent 0819784 commit ea4f31d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

util.py

+11
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ def wait(self, timeout=None):
132132
if not gotit:
133133
try:
134134
self.remove(waiter)
135+
except AttributeError:
136+
# handle python 2.4 - actually this should be made thread-safe
137+
# but lets see ...
138+
try:
139+
# lets hope we pop the right one - we don't loop over it
140+
# yet-we just keep minimal compatability with py 2.4
141+
item = self.pop()
142+
if item != waiter:
143+
self.append(item)
144+
except IndexError:
145+
pass
135146
except ValueError:
136147
pass
137148
# END didn't ever get it

0 commit comments

Comments
 (0)