sslutil: set `_canloaddefaultcerts` to `True` if `ssl.SSLContext` is present
authorManuel Jacob <me@manueljacob.de>
Sat, 30 May 2020 03:46:59 +0200
changeset 44873 47b3c8383cc1
parent 44872 aa790f7c967a
child 44874 4c53c12b92d5
sslutil: set `_canloaddefaultcerts` to `True` if `ssl.SSLContext` is present The `load_default_certs()` method was already present when `ssl.SSLContext` was backported to Python 2.7 (https://hg.python.org/cpython/rev/221a1f9155e2).
mercurial/sslutil.py
--- a/mercurial/sslutil.py	Thu May 28 16:16:13 2020 -0400
+++ b/mercurial/sslutil.py	Sat May 30 03:46:59 2020 +0200
@@ -58,7 +58,7 @@
     # SSL/TLS features are available.
     SSLContext = ssl.SSLContext
     modernssl = True
-    _canloaddefaultcerts = util.safehasattr(SSLContext, b'load_default_certs')
+    _canloaddefaultcerts = True
 except AttributeError:
     modernssl = False
     _canloaddefaultcerts = False