From: Benjamin Peterson Date: Tue, 25 Nov 2014 21:43:58 +0000 (-0600) Subject: handle errors without a reason attribute X-Git-Tag: v2.7.9rc1~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69a64d3fc21f173211ee2139a718bc8869abf2f1;p=thirdparty%2FPython%2Fcpython.git handle errors without a reason attribute --- diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 539ddb3c6de8..add406f769d3 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -488,7 +488,7 @@ def system_must_validate_cert(f): try: f(*args, **kwargs) except IOError as e: - if e.reason == "CERTIFICATE_VERIFY_FAILED": + if getattr(e, "reason", "") == "CERTIFICATE_VERIFY_FAILED": raise unittest.SkipTest("system does not contain " "necessary certificates") raise