diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-17 20:23:46 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-17 20:23:46 (GMT) |
commit | 6d8a122b9c0f9a8032030c208a467a4923a96266 (patch) | |
tree | 40d497f177b35a7e77f7bbafde81f8f9cfa8f38a | |
parent | 5ee29491e57b7477921f71e8dacfe1e1a3336912 (diff) | |
download | cpython-6d8a122b9c0f9a8032030c208a467a4923a96266.zip cpython-6d8a122b9c0f9a8032030c208a467a4923a96266.tar.gz cpython-6d8a122b9c0f9a8032030c208a467a4923a96266.tar.bz2 |
Issue #16704: Get rid of select.error in stdlib. Use OSError instead.
-rw-r--r-- | Lib/subprocess.py | 4 | ||||
-rw-r--r-- | Lib/telnetlib.py | 4 | ||||
-rw-r--r-- | Lib/test/test_logging.py | 2 | ||||
-rw-r--r-- | Lib/test/test_select.py | 2 | ||||
-rw-r--r-- | Lib/test/test_signal.py | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 09c85da..ac960f9 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -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 diff --git a/Lib/telnetlib.py b/Lib/telnetlib.py index a59693e..b7c57da 100644 --- a/Lib/telnetlib.py +++ b/Lib/telnetlib.py @@ -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 diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 54ab486..9b76055 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -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. diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py index dee5921..8f9a1c9 100644 --- a/Lib/test/test_select.py +++ b/Lib/test/test_select.py @@ -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") diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index c973be8..97e8d22 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -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: |