Fix Issue 6706: return None on connect() in case of EWOULDBLOCK/ECONNABORTED error.

This commit is contained in:
Giampaolo Rodolà 2010-11-01 15:07:14 +00:00
parent abacccc50c
commit 19e9fefc66
4 changed files with 70 additions and 37 deletions

View file

@ -350,12 +350,15 @@ class dispatcher:
# XXX can return either an address pair or None
try:
conn, addr = self.socket.accept()
return conn, addr
except socket.error, why:
if why.args[0] == EWOULDBLOCK:
pass
except TypeError:
return None
except socket.error as why:
if why.args[0] in (EWOULDBLOCK, ECONNABORTED):
return None
else:
raise
else:
return conn, addr
def send(self, data):
try: