From 69a64d3fc21f173211ee2139a718bc8869abf2f1 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 25 Nov 2014 15:43:58 -0600 Subject: [PATCH] handle errors without a reason attribute --- Lib/test/test_support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 539ddb3c6d..add406f769 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 -- 2.50.1