mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
socket.error can really happen here, and fix a possible NameError
This commit is contained in:
parent
db187847fb
commit
9bf5425f5f
1 changed files with 4 additions and 1 deletions
|
|
@ -684,6 +684,9 @@ else:
|
||||||
except ssl.SSLError, x:
|
except ssl.SSLError, x:
|
||||||
if test_support.verbose:
|
if test_support.verbose:
|
||||||
sys.stdout.write("\nSSLError is %s\n" % x[1])
|
sys.stdout.write("\nSSLError is %s\n" % x[1])
|
||||||
|
except socket.error, x:
|
||||||
|
if test_support.verbose:
|
||||||
|
sys.stdout.write("\nsocket.error is %s\n" % x[1])
|
||||||
else:
|
else:
|
||||||
self.fail("Use of invalid cert should have failed!")
|
self.fail("Use of invalid cert should have failed!")
|
||||||
finally:
|
finally:
|
||||||
|
|
@ -902,7 +905,7 @@ else:
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
try:
|
try:
|
||||||
tryProtocolCombo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
|
tryProtocolCombo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
|
||||||
except (SSLError, socket.error), x:
|
except (ssl.SSLError, socket.error), x:
|
||||||
# this fails on some older versions of OpenSSL (0.9.7l, for instance)
|
# this fails on some older versions of OpenSSL (0.9.7l, for instance)
|
||||||
if test_support.verbose:
|
if test_support.verbose:
|
||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue