04-support-python-3.12.patch 630 B

1234567891011121314
  1. --- contrib/python/tornado/tornado-4/tornado/netutil.py (index)
  2. +++ contrib/python/tornado/tornado-4/tornado/netutil.py (working tree)
  3. @@ -47,7 +47,10 @@ except ImportError:
  4. if PY3:
  5. xrange = range
  6. -if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
  7. +if sys.version_info >= (3, 12):
  8. + ssl_match_hostname = lambda cert, hostname: True
  9. + SSLCertificateError = ssl.CertificateError
  10. +elif hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
  11. ssl_match_hostname = ssl.match_hostname
  12. SSLCertificateError = ssl.CertificateError
  13. elif ssl is None: