summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2004-03-21 19:58:28 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2004-03-21 19:58:28 (GMT)
commit174bdbc999e59363739b1127b0ced4fa8e25b3dc (patch)
treea33d3542d71e957465f03477eec460a3d2ad01ca
parent419af88b34fb84062baed5c0be7f6c9e72fcb77d (diff)
downloadcpython-174bdbc999e59363739b1127b0ced4fa8e25b3dc.zip
cpython-174bdbc999e59363739b1127b0ced4fa8e25b3dc.tar.gz
cpython-174bdbc999e59363739b1127b0ced4fa8e25b3dc.tar.bz2
[Part of patch #909005] Repeating exception changed from 'raise socket.error, why' to just raise. Make use of connect_ex() raise socket.error with 2-tuple instead of just error code
-rw-r--r--Lib/asyncore.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index ba4a698..04253df 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -54,7 +54,7 @@ import time
import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
- ENOTCONN, ESHUTDOWN, EINTR, EISCONN
+ ENOTCONN, ESHUTDOWN, EINTR, EISCONN, errorcode
try:
socket_map
@@ -287,7 +287,7 @@ class dispatcher:
self.connected = True
self.handle_connect()
else:
- raise socket.error, err
+ raise socket.error, (err, errorcode[err])
def accept(self):
# XXX can return either an address pair or None
@@ -298,7 +298,7 @@ class dispatcher:
if why[0] == EWOULDBLOCK:
pass
else:
- raise socket.error, why
+ raise
def send(self, data):
try:
@@ -308,7 +308,7 @@ class dispatcher:
if why[0] == EWOULDBLOCK:
return 0
else:
- raise socket.error, why
+ raise
return 0
def recv(self, buffer_size):
@@ -327,7 +327,7 @@ class dispatcher:
self.handle_close()
return ''
else:
- raise socket.error, why
+ raise
def close(self):
self.del_channel()