summaryrefslogtreecommitdiff
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-10-23 23:49:42 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2011-10-23 23:49:42 +0200
commit24d659daafd0e6c1514ee912f06f7b7310545e09 (patch)
treedfde423cd56334b8e85e8778b491f928d6a2c20b /Lib/asyncore.py
parentdcbb822c08e75dbb45afe1c435af95961f22387a (diff)
downloadcpython-git-24d659daafd0e6c1514ee912f06f7b7310545e09.tar.gz
Use InterruptedError instead of checking for EINTR
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r--Lib/asyncore.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index e699815749..6d4bbbe309 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -54,7 +54,7 @@ import warnings
import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
- ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, EPIPE, EAGAIN, \
+ ENOTCONN, ESHUTDOWN, EISCONN, EBADF, ECONNABORTED, EPIPE, EAGAIN, \
errorcode
_DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
@@ -143,11 +143,8 @@ def poll(timeout=0.0, map=None):
try:
r, w, e = select.select(r, w, e, timeout)
- except select.error as err:
- if err.args[0] != EINTR:
- raise
- else:
- return
+ except InterruptedError:
+ return
for fd in r:
obj = map.get(fd)
@@ -190,9 +187,7 @@ def poll2(timeout=0.0, map=None):
pollster.register(fd, flags)
try:
r = pollster.poll(timeout)
- except select.error as err:
- if err.args[0] != EINTR:
- raise
+ except InterruptedError:
r = []
for fd, flags in r:
obj = map.get(fd)