mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Make socket.sslerror a subclass of socket.error .
Added socket.error to the socket module's C API.
This commit is contained in:
parent
fee6f33e08
commit
06c34798df
4 changed files with 9 additions and 1 deletions
|
@ -195,6 +195,9 @@ Core and builtins
|
||||||
Extension modules
|
Extension modules
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- socket.sslerror is now a subclass of socket.error . Also added
|
||||||
|
socket.error to the socket module's C API.
|
||||||
|
|
||||||
- Bug #920575: A problem that _locale module segfaults on
|
- Bug #920575: A problem that _locale module segfaults on
|
||||||
nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
|
nl_langinfo(ERA) caused by GNU libc's illegal NULL return is fixed.
|
||||||
|
|
||||||
|
|
|
@ -609,7 +609,9 @@ init_ssl(void)
|
||||||
SSLeay_add_ssl_algorithms();
|
SSLeay_add_ssl_algorithms();
|
||||||
|
|
||||||
/* Add symbols to module dict */
|
/* Add symbols to module dict */
|
||||||
PySSLErrorObject = PyErr_NewException("socket.sslerror", NULL, NULL);
|
PySSLErrorObject = PyErr_NewException("socket.sslerror",
|
||||||
|
PySocketModule.error,
|
||||||
|
NULL);
|
||||||
if (PySSLErrorObject == NULL)
|
if (PySSLErrorObject == NULL)
|
||||||
return;
|
return;
|
||||||
PyDict_SetItemString(d, "sslerror", PySSLErrorObject);
|
PyDict_SetItemString(d, "sslerror", PySSLErrorObject);
|
||||||
|
|
|
@ -3559,6 +3559,7 @@ static
|
||||||
PySocketModule_APIObject PySocketModuleAPI =
|
PySocketModule_APIObject PySocketModuleAPI =
|
||||||
{
|
{
|
||||||
&sock_type,
|
&sock_type,
|
||||||
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -3596,6 +3597,7 @@ init_socket(void)
|
||||||
socket_error = PyErr_NewException("socket.error", NULL, NULL);
|
socket_error = PyErr_NewException("socket.error", NULL, NULL);
|
||||||
if (socket_error == NULL)
|
if (socket_error == NULL)
|
||||||
return;
|
return;
|
||||||
|
PySocketModuleAPI.error = socket_error;
|
||||||
Py_INCREF(socket_error);
|
Py_INCREF(socket_error);
|
||||||
PyModule_AddObject(m, "error", socket_error);
|
PyModule_AddObject(m, "error", socket_error);
|
||||||
socket_herror = PyErr_NewException("socket.herror",
|
socket_herror = PyErr_NewException("socket.herror",
|
||||||
|
|
|
@ -160,6 +160,7 @@ typedef struct {
|
||||||
/* C API for usage by other Python modules */
|
/* C API for usage by other Python modules */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyTypeObject *Sock_Type;
|
PyTypeObject *Sock_Type;
|
||||||
|
PyObject *error;
|
||||||
} PySocketModule_APIObject;
|
} PySocketModule_APIObject;
|
||||||
|
|
||||||
/* XXX The net effect of the following appears to be to define a function
|
/* XXX The net effect of the following appears to be to define a function
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue