diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-27 13:13:26 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-27 13:13:26 +0000 |
commit | 9bf5425f5f26a87f4724182d8e8537437666b596 (patch) | |
tree | 5e1816f327da35f18d9de2a8b21a83fc5c5e7dc9 /Lib/test/test_ssl.py | |
parent | db187847fbe60c1dde0e26e25cf52a81c581b55d (diff) | |
download | cpython-git-9bf5425f5f26a87f4724182d8e8537437666b596.tar.gz |
socket.error can really happen here, and fix a possible NameError
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 7c13db42cf..7c32c1b09f 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -684,6 +684,9 @@ else: except ssl.SSLError, x: if test_support.verbose: 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: self.fail("Use of invalid cert should have failed!") finally: @@ -902,7 +905,7 @@ else: sys.stdout.write("\n") try: 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) if test_support.verbose: sys.stdout.write( |