summaryrefslogtreecommitdiffstats
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
authorGiampaolo RodolĂ  <g.rodola@gmail.com>2010-08-23 21:53:41 (GMT)
committerGiampaolo RodolĂ  <g.rodola@gmail.com>2010-08-23 21:53:41 (GMT)
commit76fc8c7098e61a1dd1642b9465cd21ac6310d024 (patch)
treea6c4043a564899b7ec5279b06c53d795ce27b5df /Lib/asyncore.py
parent05380645546208b67df8a9ac7ee509dffb1f77e7 (diff)
downloadcpython-76fc8c7098e61a1dd1642b9465cd21ac6310d024.zip
cpython-76fc8c7098e61a1dd1642b9465cd21ac6310d024.tar.gz
cpython-76fc8c7098e61a1dd1642b9465cd21ac6310d024.tar.bz2
fix issue 658749: correctly interprets asyncore's windows errors on connect()
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r--Lib/asyncore.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 874f101..edb1c7b 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -53,7 +53,7 @@ import time
import warnings
import os
-from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, \
+from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode
try:
@@ -337,8 +337,8 @@ class dispatcher:
def connect(self, address):
self.connected = False
err = self.socket.connect_ex(address)
- # XXX Should interpret Winsock return values
- if err in (EINPROGRESS, EALREADY, EWOULDBLOCK):
+ if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
+ or err == EINVAL and os.name in ('nt', 'ce'):
return
if err in (0, EISCONN):
self.addr = address