mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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. ........
This commit is contained in:
parent
0ba81e004a
commit
de8cf32ec8
1 changed files with 4 additions and 1 deletions
|
|
@ -82,6 +82,7 @@ from socket import dup as _dup
|
||||||
from socket import socket, AF_INET, SOCK_STREAM
|
from socket import socket, AF_INET, SOCK_STREAM
|
||||||
import base64 # for DER-to-PEM translation
|
import base64 # for DER-to-PEM translation
|
||||||
import traceback
|
import traceback
|
||||||
|
import errno
|
||||||
|
|
||||||
class SSLSocket(socket):
|
class SSLSocket(socket):
|
||||||
|
|
||||||
|
|
@ -116,7 +117,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 as e:
|
||||||
|
if e.errno != errno.ENOTCONN:
|
||||||
|
raise
|
||||||
# no, no connection yet
|
# no, no connection yet
|
||||||
self._sslobj = None
|
self._sslobj = None
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue