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

This commit is contained in:
Giampaolo Rodolà 2010-11-01 15:18:09 +00:00
parent 8581c7e11a
commit 5ea3d0f95b
4 changed files with 70 additions and 27 deletions

View file

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