summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-04-26 17:32:49 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-04-26 17:32:49 (GMT)
commit365171d8f605a950bc62398f73c4fc923be6e7cd (patch)
treec353ea304c0d7f2ace78ae5ad5eee6f131fa112b /Lib
parentd329d1a8cf7f3e6f212dc160e2e3da4f8c5db76e (diff)
downloadcpython-365171d8f605a950bc62398f73c4fc923be6e7cd.zip
cpython-365171d8f605a950bc62398f73c4fc923be6e7cd.tar.gz
cpython-365171d8f605a950bc62398f73c4fc923be6e7cd.tar.bz2
Merged revisions 80509 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80509 | antoine.pitrou | 2010-04-26 19:29:05 +0200 (lun., 26 avril 2010) | 10 lines 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')
-rw-r--r--Lib/ssl.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index caee2e5..59aff87 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -81,6 +81,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):
@@ -115,7 +116,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: