summaryrefslogtreecommitdiffstats
path: root/Lib/asyncore.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-10-23 21:49:42 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-10-23 21:49:42 (GMT)
commit24d659daafd0e6c1514ee912f06f7b7310545e09 (patch)
treedfde423cd56334b8e85e8778b491f928d6a2c20b /Lib/asyncore.py
parentdcbb822c08e75dbb45afe1c435af95961f22387a (diff)
downloadcpython-24d659daafd0e6c1514ee912f06f7b7310545e09.zip
cpython-24d659daafd0e6c1514ee912f06f7b7310545e09.tar.gz
cpython-24d659daafd0e6c1514ee912f06f7b7310545e09.tar.bz2
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 e699815..6d4bbbe 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)