[Python-checkins] cpython (2.7): handle errors without a reason attribute

benjamin.peterson python-checkins at python.org
Tue Nov 25 22:44:14 CET 2014


https://hg.python.org/cpython/rev/8ca79131ca65
changeset:   93587:8ca79131ca65
branch:      2.7
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Nov 25 15:43:58 2014 -0600
summary:
  handle errors without a reason attribute

files:
  Lib/test/test_support.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -488,7 +488,7 @@
         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

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list