bpo-28958: Improve SSLContext error reporting. (#3414)

Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
Christian Heimes 2017-09-07 14:14:00 -07:00 committed by GitHub
parent 3147b0422c
commit 17c9ac927b
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1,2 @@
ssl.SSLContext() now uses OpenSSL error information when a context cannot be
instantiated.

View File

@ -2636,8 +2636,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
return NULL;
}
if (ctx == NULL) {
PyErr_SetString(PySSLErrorObject,
"failed to allocate SSL context");
_setSSLError(NULL, 0, __FILE__, __LINE__);
return NULL;
}