aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/tornado/tornado-4/patches/04-support-python-3.12.patch
blob: 5ebbbc662a7ee1cba330393b21fdc99414b5ecd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- contrib/python/tornado/tornado-4/tornado/netutil.py	(index)
+++ contrib/python/tornado/tornado-4/tornado/netutil.py	(working tree)
@@ -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: