Kaydet (Commit) 6d8a122b authored tarafından Andrew Svetlov's avatar Andrew Svetlov

Issue #16704: Get rid of select.error in stdlib. Use OSError instead.

üst 5ee29491
......@@ -1614,7 +1614,7 @@ class Popen(object):
raise TimeoutExpired(self.args, orig_timeout)
try:
ready = poller.poll(timeout)
except select.error as e:
except OSError as e:
if e.args[0] == errno.EINTR:
continue
raise
......@@ -1682,7 +1682,7 @@ class Popen(object):
(rlist, wlist, xlist) = \
select.select(self._read_set, self._write_set, [],
timeout)
except select.error as e:
except OSError as e:
if e.args[0] == errno.EINTR:
continue
raise
......
......@@ -313,7 +313,7 @@ class Telnet:
while i < 0 and not self.eof:
try:
ready = poller.poll(call_timeout)
except select.error as e:
except OSError as e:
if e.errno == errno.EINTR:
if timeout is not None:
elapsed = time() - time_start
......@@ -683,7 +683,7 @@ class Telnet:
while not m and not self.eof:
try:
ready = poller.poll(call_timeout)
except select.error as e:
except OSError as e:
if e.errno == errno.EINTR:
if timeout is not None:
elapsed = time() - time_start
......
......@@ -773,7 +773,7 @@ if threading:
"""
try:
asyncore.loop(poll_interval, map=self.sockmap)
except select.error:
except OSError:
# On FreeBSD 8, closing the server repeatably
# raises this error. We swallow it if the
# server has been closed.
......
......@@ -32,7 +32,7 @@ class SelectTestCase(unittest.TestCase):
fp.close()
try:
select.select([fd], [], [], 0)
except select.error as err:
except OSError as err:
self.assertEqual(err.errno, errno.EBADF)
else:
self.fail("exception not raised")
......
......@@ -299,10 +299,10 @@ class WakeupSignalTests(unittest.TestCase):
# We attempt to get a signal during the select call
try:
select.select([read], [], [], TIMEOUT_FULL)
except select.error:
except OSError:
pass
else:
raise Exception("select.error not raised")
raise Exception("OSError not raised")
after_time = time.time()
dt = after_time - before_time
if dt >= TIMEOUT_HALF:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment