Fixed test to reflect new filedispatcher semantics, as well as two

NameErrors pointed out by Giampaolo.
This commit is contained in:
Josiah Carlson 2008-06-10 15:58:19 +00:00
parent 1cec7aa7c7
commit b67b53db51
2 changed files with 4 additions and 4 deletions

View File

@ -228,7 +228,7 @@ class dispatcher:
# 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 @@ class dispatcher:
#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()

View File

@ -384,8 +384,8 @@ if hasattr(asyncore, 'file_wrapper'):
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()