Add SSLCertVerificationError for 3.7+ (#2729)

As of 3.7, ssl.CertificateError became an alias for the new
SSLCertVerificationError.
This commit is contained in:
Hynek Schlawack
2019-01-09 08:17:39 +00:00
committed by Sebastian Rittau
parent 2ea8abc1c7
commit 0854df365d

View File

@@ -27,7 +27,13 @@ class SSLWantReadError(SSLError): ...
class SSLWantWriteError(SSLError): ...
class SSLSyscallError(SSLError): ...
class SSLEOFError(SSLError): ...
class CertificateError(Exception): ...
if sys.version_info >= (3, 7):
class SSLCertVerificationError(SSLError, ValueError): ...
CertificateError = SSLCertVerificationError
else:
class CertificateError(ValueError): ...
def wrap_socket(sock: socket.socket, keyfile: Optional[str] = ...,