changeset 49382:eec5e00e782d

sslutil: use proper attribute to select python 3.7+ The previous attribute was python 3.6+, but guarded a python 3.7+ block. Using the correct attribute avoids: File "/usr/lib64/python3.6/site-packages/mercurial/sslutil.py", line 334, in wrapsocket sslcontext.minimum_version = ssl.TLSVersion.TLSv1_1 AttributeError: module 'ssl' has no attribute 'TLSVersion'
author Mathias De Mare <mathias.de_mare@nokia.com>
date Tue, 12 Jul 2022 15:59:53 +0200
parents 259df3e3152c
children de2e158c380a
files mercurial/sslutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sslutil.py	Mon Jul 11 09:54:40 2022 +0200
+++ b/mercurial/sslutil.py	Tue Jul 12 15:59:53 2022 +0200
@@ -312,7 +312,7 @@
     # is loaded and contains that removed CA, you've just undone the user's
     # choice.
 
-    if util.safehasattr(ssl, 'PROTOCOL_TLS_CLIENT'):
+    if util.safehasattr(ssl, 'TLSVersion'):
         # python 3.7+
         sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
         minimumprotocol = settings[b'minimumprotocol']