use more ugly but hopefully more robust method

This commit is contained in:
Benjamin Peterson 2014-11-25 16:12:32 -06:00
parent 69a64d3fc2
commit f7363ed8ef
1 changed files with 1 additions and 1 deletions

View File

@ -488,7 +488,7 @@ def system_must_validate_cert(f):
try:
f(*args, **kwargs)
except IOError as e:
if getattr(e, "reason", "") == "CERTIFICATE_VERIFY_FAILED":
if "CERTIFICATE_VERIFY_FAILED" in str(e):
raise unittest.SkipTest("system does not contain "
"necessary certificates")
raise