diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-05 22:31:58 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-05 22:31:58 (GMT) |
commit | b173f7853e4e3a4215a661d98174291e379cf6fb (patch) | |
tree | 02735987f20fc27277a82c14c5da5e043cc134aa /Modules/_ssl.c | |
parent | c679fd8efcae2b5d1117fc09380d74f0000086b0 (diff) | |
download | cpython-b173f7853e4e3a4215a661d98174291e379cf6fb.zip cpython-b173f7853e4e3a4215a661d98174291e379cf6fb.tar.gz cpython-b173f7853e4e3a4215a661d98174291e379cf6fb.tar.bz2 |
add a replacement API for PyCObject, PyCapsule #5630
All stdlib modules with C-APIs now use this.
Patch by Larry Hastings
Diffstat (limited to 'Modules/_ssl.c')
-rw-r--r-- | Modules/_ssl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 3c9dd61..b400057 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -71,6 +71,8 @@ enum py_ssl_version { /* Include symbols from _socket module */ #include "socketmodule.h" +static PySocketModule_APIObject PySocketModule; + #if defined(HAVE_POLL_H) #include <poll.h> #elif defined(HAVE_SYS_POLL_H) @@ -1626,6 +1628,7 @@ PyMODINIT_FUNC PyInit__ssl(void) { PyObject *m, *d; + PySocketModule_APIObject *socket_api; if (PyType_Ready(&PySSL_Type) < 0) return NULL; @@ -1636,8 +1639,10 @@ PyInit__ssl(void) d = PyModule_GetDict(m); /* Load _socket module and its C API */ - if (PySocketModule_ImportModuleAndAPI()) + socket_api = PySocketModule_ImportModuleAndAPI(); + if (!socket_api) return NULL; + PySocketModule = *socket_api; /* Init OpenSSL */ SSL_load_error_strings(); |