[Zope-Checkins] SVN: Zope/trunk/lib/python/ZServer/medusa/monitor.py Collector 1542: Python 2.4/Zope 2.8 unittest failure in asyncore.py

Tim Peters tim.one at comcast.net
Mon Oct 18 16:01:20 EDT 2004


Log message for revision 28212:
  Collector 1542:  Python 2.4/Zope 2.8 unittest failure in asyncore.py
  
  Forward port form 2.7 branch.
  
  medusa's class monitor_server derives from asyncore.dispatcher, but
  never called the latter's constructor.  As a result, the ._map attribute
  set by 2.4's asyncore.dispatcher.__init__() never gets set, and calling
  asyncore methods later dies with an AttributeError on ._map.  The fix
  is a 1-liner, adding a call to the base-class constructor.
  

Changed:
  U   Zope/trunk/lib/python/ZServer/medusa/monitor.py

-=-
Modified: Zope/trunk/lib/python/ZServer/medusa/monitor.py
===================================================================
--- Zope/trunk/lib/python/ZServer/medusa/monitor.py	2004-10-18 19:33:59 UTC (rev 28211)
+++ Zope/trunk/lib/python/ZServer/medusa/monitor.py	2004-10-18 20:01:20 UTC (rev 28212)
@@ -163,6 +163,7 @@
     channel_class = monitor_channel
     
     def __init__ (self, hostname='127.0.0.1', port=8023):
+        asyncore.dispatcher.__init__(self)
         self.hostname = hostname
         self.port = port
         self.create_socket (socket.AF_INET, socket.SOCK_STREAM)



More information about the Zope-Checkins mailing list