فهرست منبع

- Removed use of collections.deque in our bundled version of asynchat
because it broke compatibility with Python 2.3.

Mike Naberezny 15 سال پیش
والد
کامیت
67627e7954
2فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  1. 3 0
      CHANGES.txt
  2. 4 5
      src/supervisor/medusa/asynchat_25.py

+ 3 - 0
CHANGES.txt

@@ -51,6 +51,9 @@ Next Release
     when it can't connect to supervisord on the expected socket.  Thanks
     when it can't connect to supervisord on the expected socket.  Thanks
     to Benjamin Smith for reporting this.
     to Benjamin Smith for reporting this.
 
 
+  - Removed use of collections.deque in our bundled version of asynchat
+    because it broke compatibility with Python 2.3.
+
 3.0a7 (2009-05-24)
 3.0a7 (2009-05-24)
  
  
   - We now bundle our own patched version of Medusa contributed by Jason
   - We now bundle our own patched version of Medusa contributed by Jason

+ 4 - 5
src/supervisor/medusa/asynchat_25.py

@@ -48,7 +48,6 @@ you - by calling your self.found_terminator() method.
 
 
 import socket
 import socket
 from supervisor.medusa import asyncore_25 as asyncore
 from supervisor.medusa import asyncore_25 as asyncore
-from collections import deque
 
 
 class async_chat (asyncore.dispatcher):
 class async_chat (asyncore.dispatcher):
     """This is an abstract class.  You must derive from this class, and add
     """This is an abstract class.  You must derive from this class, and add
@@ -251,15 +250,15 @@ class simple_producer:
 class fifo:
 class fifo:
     def __init__ (self, list=None):
     def __init__ (self, list=None):
         if not list:
         if not list:
-            self.list = deque()
+            self.list = []
         else:
         else:
-            self.list = deque(list)
+            self.list = list
 
 
     def __len__ (self):
     def __len__ (self):
         return len(self.list)
         return len(self.list)
 
 
     def is_empty (self):
     def is_empty (self):
-        return not self.list
+        return self.list == []
 
 
     def first (self):
     def first (self):
         return self.list[0]
         return self.list[0]
@@ -269,7 +268,7 @@ class fifo:
 
 
     def pop (self):
     def pop (self):
         if self.list:
         if self.list:
-            return (1, self.list.popleft())
+            return (1, self.list.pop(0))
         else:
         else:
             return (0, None)
             return (0, None)