# HG changeset patch # User Ondrej Pohorelsky # Date 2022-07-13 16:27:40 # Node ID de2e158c380a764b469b3e0360ed27311fb2f1e0 # Parent eec5e00e782d83228f3f97f88f4bcf3d10b2ea1b sslutil: another 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 "/tmp/hgtests.bc0_uk2d/install/lib/python/mercurial/sslutil.py", line 577, in wrapserversocket + sslcontext.minimum_version = ssl.TLSVersion.TLSv1_1 + AttributeError: module 'ssl' has no attribute 'TLSVersion' diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py --- a/mercurial/sslutil.py +++ b/mercurial/sslutil.py @@ -546,7 +546,7 @@ def wrapserversocket( _(b'referenced certificate file (%s) does not exist') % f ) - if util.safehasattr(ssl, 'PROTOCOL_TLS_SERVER'): + if util.safehasattr(ssl, 'TLSVersion'): # python 3.7+ sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) sslcontext.options |= getattr(ssl, 'OP_NO_COMPRESSION', 0)