[Python-checkins] r64080 - in python/trunk/Lib: asyncore.py test/test_asyncore.py

josiah.carlson python-checkins at python.org
Tue Jun 10 17:58:20 CEST 2008


Author: josiah.carlson
Date: Tue Jun 10 17:58:19 2008
New Revision: 64080

Log:
Fixed test to reflect new filedispatcher semantics, as well as two
NameErrors pointed out by Giampaolo.


Modified:
   python/trunk/Lib/asyncore.py
   python/trunk/Lib/test/test_asyncore.py

Modified: python/trunk/Lib/asyncore.py
==============================================================================
--- python/trunk/Lib/asyncore.py	(original)
+++ python/trunk/Lib/asyncore.py	Tue Jun 10 17:58:19 2008
@@ -228,7 +228,7 @@
             # passed be connected.
             try:
                 self.addr = sock.getpeername()
-            except socket.error:
+            except socket.error, err:
                 if err[0] == ENOTCONN:
                     # To handle the case where we got an unconnected
                     # socket.
@@ -424,7 +424,7 @@
             #check for errors
             err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
             if err != 0:
-                raise socket.error(err, strerror(err))
+                raise socket.error(err, _strerror(err))
 
             self.handle_connect_event()
         self.handle_write()

Modified: python/trunk/Lib/test/test_asyncore.py
==============================================================================
--- python/trunk/Lib/test/test_asyncore.py	(original)
+++ python/trunk/Lib/test/test_asyncore.py	Tue Jun 10 17:58:19 2008
@@ -384,8 +384,8 @@
             fd = os.open(TESTFN, os.O_RDONLY)
             w = asyncore.file_wrapper(fd)
 
-            self.assertEqual(w.fd, fd)
-            self.assertEqual(w.fileno(), fd)
+            self.assertNotEqual(w.fd, fd)
+            self.assertNotEqual(w.fileno(), fd)
             self.assertEqual(w.recv(13), "It's not dead")
             self.assertEqual(w.read(6), ", it's")
             w.close()


More information about the Python-checkins mailing list