From 94d6fba9e103d618fba36018d826bd9ffe33b332 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 27 Apr 2010 13:14:50 +0000 Subject: [PATCH] Merged revisions 80534 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80534 | antoine.pitrou | 2010-04-27 15:13:26 +0200 (mar., 27 avril 2010) | 3 lines socket.error can really happen here, and fix a possible NameError ........ --- Lib/test/test_ssl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index e8f03d1c36f..cc04f4c54c6 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -647,6 +647,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: @@ -858,7 +861,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(