Commit b5be1d52 authored by Denis Bilenko's avatar Denis Bilenko

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

When calling getpeername() in SSLSocket.__init__, only silence exceptions caused by the "socket not connected" condition. Patch by Antoine Pitrou.

from http://svn.python.org/view?view=rev&revision=80507
parent 565fb06b
...@@ -72,7 +72,9 @@ class SSLSocket(socket): ...@@ -72,7 +72,9 @@ 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, e:
if e[0] != errno.ENOTCONN:
raise
# no, no connection yet # no, no connection yet
self._sslobj = None self._sslobj = None
else: 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