summaryrefslogtreecommitdiffstats
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
authorGiampaolo RodolĂ  <g.rodola@gmail.com>2011-03-03 13:59:28 (GMT)
committerGiampaolo RodolĂ  <g.rodola@gmail.com>2011-03-03 13:59:28 (GMT)
commit9c9105dc8137b48c81154f6b194767bf4afd8812 (patch)
tree21175c09c64fd4c23d6cb91ad93530d6c47f04bc /Lib/asyncore.py
parentc7eb7894d3a0878af72bfec9b65d12dd0a1e28e9 (diff)
downloadcpython-9c9105dc8137b48c81154f6b194767bf4afd8812.zip
cpython-9c9105dc8137b48c81154f6b194767bf4afd8812.tar.gz
cpython-9c9105dc8137b48c81154f6b194767bf4afd8812.tar.bz2
Merged revisions 88722 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88722 | giampaolo.rodola | 2011-03-03 14:57:47 +0100 (gio, 03 mar 2011) | 1 line Fix issue 11265: asyncore now correctly handles EPIPE, EBADF and EAGAIN errors on accept(), recv() and send(). ........
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r--Lib/asyncore.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index a277bdd..0ad78db 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -54,9 +54,10 @@ import warnings
import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
- ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode
+ ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, EPIPE, errorcode
-_DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED))
+_DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
+ EBADF))
try:
socket_map
@@ -111,7 +112,7 @@ def readwrite(obj, flags):
if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
obj.handle_close()
except socket.error as e:
- if e.args[0] not in (EBADF, ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
+ if e.args[0] not in _DISCONNECTED:
obj.handle_error()
else:
obj.handle_close()
@@ -355,7 +356,7 @@ class dispatcher:
except TypeError:
return None
except socket.error as why:
- if why.args[0] in (EWOULDBLOCK, ECONNABORTED):
+ if why.args[0] in (EWOULDBLOCK, ECONNABORTED, EAGAIN):
return None
else:
raise