Kaydet (Commit) 278d665c authored tarafından Antoine Pitrou's avatar Antoine Pitrou

When calling getpeername() in SSLSocket.__init__, only silence exceptions

caused by the "socket not connected" condition.
üst 3bfa8832
......@@ -78,6 +78,7 @@ from _ssl import \
from socket import socket, _fileobject, _delegate_methods, error as socket_error
from socket import getnameinfo as _getnameinfo
import base64 # for DER-to-PEM translation
import errno
class SSLSocket(socket):
......@@ -105,7 +106,9 @@ class SSLSocket(socket):
# see if it's connected
try:
socket.getpeername(self)
except socket_error:
except socket_error, e:
if e.errno != errno.ENOTCONN:
raise
# no, no connection yet
self._sslobj = None
else:
......
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