sslutil: don't access message attribute in exception (issue5285) stable
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 02 Jul 2016 09:41:40 -0700
branchstable
changeset 29460 a7d1532b26a1
parent 29454 ddbff1435e7b
child 29501 be68a4445041
child 29605 519bb4f9d3a4
sslutil: don't access message attribute in exception (issue5285) I should have ran the entire test suite on Python 2.6. Since the hostname matching tests are implemented in Python (not .t tests), it didn't uncover this warning. I'm not sure why - warnings should be printed regardless. This is possibly a bug in the test runner. But that's for another day...
mercurial/sslutil.py
--- a/mercurial/sslutil.py	Fri Jul 01 15:12:33 2016 -0500
+++ b/mercurial/sslutil.py	Sat Jul 02 09:41:40 2016 -0700
@@ -236,7 +236,7 @@
                 if _dnsnamematch(value, hostname):
                     return
             except wildcarderror as e:
-                return e.message
+                return e.args[0]
 
             dnsnames.append(value)
 
@@ -257,7 +257,7 @@
                         if _dnsnamematch(value, hostname):
                             return
                     except wildcarderror as e:
-                        return e.message
+                        return e.args[0]
 
                     dnsnames.append(value)