summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-04-26 17:29:05 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-04-26 17:29:05 (GMT)
commitde8cf32ec834539bceffa5fae28f822be684f9f2 (patch)
tree2950eeffd5396fae51d0e955af5b54636a1c9287 /Lib/ssl.py
parent0ba81e004a51f958503c4e952a38a70140e2f0f9 (diff)
downloadcpython-de8cf32ec834539bceffa5fae28f822be684f9f2.zip
cpython-de8cf32ec834539bceffa5fae28f822be684f9f2.tar.gz
cpython-de8cf32ec834539bceffa5fae28f822be684f9f2.tar.bz2
Merged revisions 80507 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80507 | antoine.pitrou | 2010-04-26 19:23:33 +0200 (lun., 26 avril 2010) | 4 lines When calling getpeername() in SSLSocket.__init__, only silence exceptions caused by the "socket not connected" condition. ........
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index f06792e..8ab3254 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -82,6 +82,7 @@ from socket import dup as _dup
from socket import socket, AF_INET, SOCK_STREAM
import base64 # for DER-to-PEM translation
import traceback
+import errno
class SSLSocket(socket):
@@ -116,7 +117,9 @@ class SSLSocket(socket):
# see if it's connected
try:
socket.getpeername(self)
- except socket_error:
+ except socket_error as e:
+ if e.errno != errno.ENOTCONN:
+ raise
# no, no connection yet
self._sslobj = None
else: