summaryrefslogtreecommitdiffstats
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r--Lib/asyncore.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 16fe43a..8b9ba87 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -103,10 +103,16 @@ def readwrite(obj, flags):
obj.handle_read_event()
if flags & select.POLLOUT:
obj.handle_write_event()
- if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
- obj.handle_close()
if flags & select.POLLPRI:
obj.handle_expt_event()
+ if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
+ obj.handle_close()
+ except socket.error, e:
+ if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN,
+ECONNABORTED):
+ obj.handle_error()
+ else:
+ obj.handle_close()
except _reraised_exceptions:
raise
except: