fix name collision issues

This commit is contained in:
Benjamin Peterson 2008-12-31 04:08:55 +00:00
parent 43ea6d9acc
commit 941db4d91f

View file

@ -74,7 +74,7 @@ from _ssl import \
SSL_ERROR_EOF, \ SSL_ERROR_EOF, \
SSL_ERROR_INVALID_ERROR_CODE SSL_ERROR_INVALID_ERROR_CODE
from socket import socket, _fileobject from socket import socket, _fileobject, error as socket_error
from socket import getnameinfo as _getnameinfo from socket import getnameinfo as _getnameinfo
import base64 # for DER-to-PEM translation import base64 # for DER-to-PEM translation
@ -103,7 +103,7 @@ class SSLSocket (socket):
# see if it's connected # see if it's connected
try: try:
socket.getpeername(self) socket.getpeername(self)
except socket.error: except socket_error:
# no, no connection yet # no, no connection yet
self._sslobj = None self._sslobj = None
else: else:
@ -441,7 +441,7 @@ def sslwrap_simple (sock, keyfile=None, certfile=None):
PROTOCOL_SSLv23, None) PROTOCOL_SSLv23, None)
try: try:
sock.getpeername() sock.getpeername()
except socket.error: except socket_error:
# no, no connection yet # no, no connection yet
pass pass
else: else: