[Checkins] SVN: zc.ngi/trunk/src/zc/ngi/async. Fixed some api bugs that became effective with Python 2.6.

Jim Fulton jim at zope.com
Mon Apr 13 10:39:03 EDT 2009


Log message for revision 99150:
  Fixed some api bugs that became effective with Python 2.6.
  

Changed:
  U   zc.ngi/trunk/src/zc/ngi/async.py
  U   zc.ngi/trunk/src/zc/ngi/async.txt

-=-
Modified: zc.ngi/trunk/src/zc/ngi/async.py
===================================================================
--- zc.ngi/trunk/src/zc/ngi/async.py	2009-04-13 14:03:22 UTC (rev 99149)
+++ zc.ngi/trunk/src/zc/ngi/async.py	2009-04-13 14:39:02 UTC (rev 99150)
@@ -395,8 +395,9 @@
         else:
             self.__close_handler = handler
 
-    def add_channel(self):
+    def add_channel(self, map=None):
         # work around file-dispatcher bug
+        assert (map is None) or (map is _map)
         asyncore.dispatcher.add_channel(self, _map)
 
     def handle_error(self):
@@ -445,8 +446,9 @@
                 self.logger.debug('pulled %s', pid)
             os.write(self.__writefd, 'x')
 
-        def add_channel(self):
+        def add_channel(self, map=None):
             # work around file-dispatcher bug
+            assert (map is None) or (map is _map)
             asyncore.dispatcher.add_channel(self, _map)
 
 else:

Modified: zc.ngi/trunk/src/zc/ngi/async.txt
===================================================================
--- zc.ngi/trunk/src/zc/ngi/async.txt	2009-04-13 14:03:22 UTC (rev 99149)
+++ zc.ngi/trunk/src/zc/ngi/async.txt	2009-04-13 14:39:02 UTC (rev 99150)
@@ -72,10 +72,10 @@
    access it's _connection attribute so that we can bypass the check
    in the blocking writelines method:
 
-    >>> output._connection.writelines(2)
+    >>> output._connection.writelines(2) # doctest: +ELLIPSIS
     Traceback (most recent call last):
     ...
-    TypeError: iteration over non-sequence
+    TypeError: ...
 
     >>> output._connection.writelines('foo')
     Traceback (most recent call last):



More information about the Checkins mailing list