summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 21:10:48 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 21:10:48 (GMT)
commit0832af6628ca5ac02d0226899725297dd508470b (patch)
treefc4e7d05d9c6f51eb97f3e8abbcab2b226330b94 /Lib/ssl.py
parentad28c7f9dad791567afa0624acfb3ba430851965 (diff)
downloadcpython-0832af6628ca5ac02d0226899725297dd508470b.zip
cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.gz
cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.bz2
Issue #16717: get rid of socket.error, replace with OSError
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 5e5a5ce..acbc700 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -109,12 +109,14 @@ else:
_PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
from socket import getnameinfo as _getnameinfo
-from socket import error as socket_error
from socket import socket, AF_INET, SOCK_STREAM, create_connection
import base64 # for DER-to-PEM translation
import traceback
import errno
+
+socket_error = OSError # keep that public name in module namespace
+
if _ssl.HAS_TLS_UNIQUE:
CHANNEL_BINDING_TYPES = ['tls-unique']
else:
@@ -279,7 +281,7 @@ class SSLSocket(socket):
# see if it's connected
try:
sock.getpeername()
- except socket_error as e:
+ except OSError as e:
if e.errno != errno.ENOTCONN:
raise
else:
@@ -305,7 +307,7 @@ class SSLSocket(socket):
raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
self.do_handshake()
- except socket_error as x:
+ except OSError as x:
self.close()
raise x
@@ -533,7 +535,7 @@ class SSLSocket(socket):
self.do_handshake()
self._connected = True
return rc
- except socket_error:
+ except OSError:
self._sslobj = None
raise