summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-25 21:43:58 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-11-25 21:43:58 (GMT)
commit69a64d3fc21f173211ee2139a718bc8869abf2f1 (patch)
treeda2e542136575ac51767eb7b95c89464ca6172b8
parentf671de4dd4b3c8fd124f45e863b4f07ffc1c9179 (diff)
downloadcpython-69a64d3fc21f173211ee2139a718bc8869abf2f1.zip
cpython-69a64d3fc21f173211ee2139a718bc8869abf2f1.tar.gz
cpython-69a64d3fc21f173211ee2139a718bc8869abf2f1.tar.bz2
handle errors without a reason attribute
-rw-r--r--Lib/test/test_support.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 539ddb3..add406f 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