Mercurial > hg
changeset 49388:4a1f0bc0713e stable
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'
author | Ondrej Pohorelsky <opohorel@redhat.com> |
---|---|
date | Wed, 13 Jul 2022 18:27:40 +0200 |
parents | be3828081624 |
children | 34e15bbab67c |
files | mercurial/sslutil.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/sslutil.py Tue Jul 12 15:59:53 2022 +0200 +++ b/mercurial/sslutil.py Wed Jul 13 18:27:40 2022 +0200 @@ -546,7 +546,7 @@ _(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)