aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-12-13 12:02:33 +0300
committershadchin <shadchin@yandex-team.com>2023-12-13 12:58:45 +0300
commitcbe0aef5798fe4876112a4b850aad8e5b55538a1 (patch)
tree74fb6b522fc5b53c99682ad5d2ea2ec04957ea27
parent21424fe08068308283c62e2549401e15f964094d (diff)
downloadydb-cbe0aef5798fe4876112a4b850aad8e5b55538a1.tar.gz
Support Python 3.12 for `tornado-4`
-rw-r--r--contrib/python/tornado/tornado-4/tornado/netutil.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/python/tornado/tornado-4/tornado/netutil.py b/contrib/python/tornado/tornado-4/tornado/netutil.py
index 59df1435ea..ad9eb624d9 100644
--- a/contrib/python/tornado/tornado-4/tornado/netutil.py
+++ b/contrib/python/tornado/tornado-4/tornado/netutil.py
@@ -47,7 +47,10 @@ except ImportError:
if PY3:
xrange = range
-if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
+if sys.version_info >= (3, 12):
+ ssl_match_hostname = lambda cert, hostname: True
+ SSLCertificateError = ssl.CertificateError
+elif hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
ssl_match_hostname = ssl.match_hostname
SSLCertificateError = ssl.CertificateError
elif ssl is None: