bpo-42333: Port _ssl extension to multiphase initialization (PEP 489) (GH-23253)

- Introduce sslmodule_slots
- Introduce sslmodulestate
- Use sslmodulestate
- Get rid of PyState_FindModule
- Move new structs and helpers to header file
- Use macros to access state
- Keep a strong ref to socket type
This commit is contained in:
Christian Heimes 2021-04-17 20:06:38 +02:00 committed by GitHub
parent 76beadb8ff
commit 7f1305ef9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 468 additions and 366 deletions

View file

@ -2428,14 +2428,6 @@ class PyBuildExt(build_ext):
self.missing.extend(['_ssl', '_hashlib'])
return None, None
self.add(Extension(
'_ssl', ['_ssl.c'],
include_dirs=openssl_includes,
library_dirs=openssl_libdirs,
libraries=openssl_libs,
depends=['socketmodule.h', '_ssl/debughelpers.c'])
)
if openssl_rpath == 'auto':
runtime_library_dirs = openssl_libdirs[:]
elif not openssl_rpath:
@ -2469,7 +2461,7 @@ class PyBuildExt(build_ext):
Extension(
'_ssl',
['_ssl.c'],
depends=['socketmodule.h', '_ssl/debughelpers.c'],
depends=['socketmodule.h', '_ssl/debughelpers.c', '_ssl.h'],
**openssl_extension_kwargs
)
)