diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 21:10:48 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 21:10:48 (GMT) |
commit | 0832af6628ca5ac02d0226899725297dd508470b (patch) | |
tree | fc4e7d05d9c6f51eb97f3e8abbcab2b226330b94 /Lib/idlelib | |
parent | ad28c7f9dad791567afa0624acfb3ba430851965 (diff) | |
download | cpython-0832af6628ca5ac02d0226899725297dd508470b.zip cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.gz cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.bz2 |
Issue #16717: get rid of socket.error, replace with OSError
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/PyShell.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/rpc.py | 8 | ||||
-rw-r--r-- | Lib/idlelib/run.py | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index bff52a9..696d363 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -393,7 +393,7 @@ class ModifiedInterpreter(InteractiveInterpreter): try: self.rpcclt = MyRPCClient(addr) break - except socket.error as err: + except OSError as err: pass else: self.display_port_binding_error() diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 77cb3ac..44b3430 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -199,7 +199,7 @@ class SocketIO(object): raise except KeyboardInterrupt: raise - except socket.error: + except OSError: raise except Exception as ex: return ("CALLEXC", ex) @@ -340,7 +340,7 @@ class SocketIO(object): n = self.sock.send(s[:BUFSIZE]) except (AttributeError, TypeError): raise IOError("socket no longer exists") - except socket.error: + except OSError: raise else: s = s[n:] @@ -357,7 +357,7 @@ class SocketIO(object): return None try: s = self.sock.recv(BUFSIZE) - except socket.error: + except OSError: raise EOFError if len(s) == 0: raise EOFError @@ -537,7 +537,7 @@ class RPCClient(SocketIO): SocketIO.__init__(self, working_sock) else: print("** Invalid host: ", address, file=sys.__stderr__) - raise socket.error + raise OSError def get_remote_proxy(self, oid): return RPCProxy(self, oid) diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 9872af4..5d321af 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -135,8 +135,8 @@ def manage_socket(address): try: server = MyRPCServer(address, MyHandler) break - except socket.error as err: - print("IDLE Subprocess: socket error: " + err.args[1] + + except OSError as err: + print("IDLE Subprocess: OSError: " + err.args[1] + ", retrying....", file=sys.__stderr__) socket_error = err else: |