[Python-checkins] r80509 - in python/branches/py3k: Lib/ssl.py

antoine.pitrou python-checkins at python.org
Mon Apr 26 19:29:05 CEST 2010


Author: antoine.pitrou
Date: Mon Apr 26 19:29:05 2010
New Revision: 80509

Log:
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.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/ssl.py

Modified: python/branches/py3k/Lib/ssl.py
==============================================================================
--- python/branches/py3k/Lib/ssl.py	(original)
+++ python/branches/py3k/Lib/ssl.py	Mon Apr 26 19:29:05 2010
@@ -82,6 +82,7 @@
 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 @@
         # 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:


More information about the Python-checkins mailing list