Asyncore update

- handle WSAENOTSOCK
This commit is contained in:
Peter Šurda 2017-05-29 13:14:25 +02:00
parent a5c1b0c529
commit 97c44b97f4
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -63,6 +63,10 @@ try:
from errno import WSAEWOULDBLOCK from errno import WSAEWOULDBLOCK
except (ImportError, AttributeError): except (ImportError, AttributeError):
WSAEWOULDBLOCK = EWOULDBLOCK WSAEWOULDBLOCK = EWOULDBLOCK
try:
from errno import WSAENOTSOCK
except (ImportError, AttributeError):
WSAENOTSOCK = ENOTSOCK
from ssl import SSLError, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE from ssl import SSLError, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE
@ -201,7 +205,7 @@ def select_poller(timeout=0.0, map=None):
except KeyboardInterrupt: except KeyboardInterrupt:
return return
except socket.error as err: except socket.error as err:
if err.args[0] in (EBADF): if err.args[0] in (EBADF, WSAENOTSOCK):
return return
for fd in random.sample(r, len(r)): for fd in random.sample(r, len(r)):