[Supervisor-checkins] r905 - in supervisor/trunk: . src/supervisor/medusa

Mike Naberezny mike at maintainable.com
Sat Oct 24 21:49:49 EDT 2009


Author: Mike Naberezny <mike at maintainable.com>
Date: Sat Oct 24 21:49:49 2009
New Revision: 905

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



Modified:
   supervisor/trunk/CHANGES.txt
   supervisor/trunk/src/supervisor/medusa/asynchat_25.py

Modified: supervisor/trunk/CHANGES.txt
==============================================================================
--- supervisor/trunk/CHANGES.txt	(original)
+++ supervisor/trunk/CHANGES.txt	Sat Oct 24 21:49:49 2009
@@ -51,6 +51,9 @@
     when it can't connect to supervisord on the expected socket.  Thanks
     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)
  
   - We now bundle our own patched version of Medusa contributed by Jason

Modified: supervisor/trunk/src/supervisor/medusa/asynchat_25.py
==============================================================================
--- supervisor/trunk/src/supervisor/medusa/asynchat_25.py	(original)
+++ supervisor/trunk/src/supervisor/medusa/asynchat_25.py	Sat Oct 24 21:49:49 2009
@@ -48,7 +48,6 @@
 
 import socket
 from supervisor.medusa import asyncore_25 as asyncore
-from collections import deque
 
 class async_chat (asyncore.dispatcher):
     """This is an abstract class.  You must derive from this class, and add
@@ -251,15 +250,15 @@
 class fifo:
     def __init__ (self, list=None):
         if not list:
-            self.list = deque()
+            self.list = []
         else:
-            self.list = deque(list)
+            self.list = list
 
     def __len__ (self):
         return len(self.list)
 
     def is_empty (self):
-        return not self.list
+        return self.list == []
 
     def first (self):
         return self.list[0]
@@ -269,7 +268,7 @@
 
     def pop (self):
         if self.list:
-            return (1, self.list.popleft())
+            return (1, self.list.pop(0))
         else:
             return (0, None)
 


More information about the Supervisor-checkins mailing list