mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-86493: Modernize modules initialization code (GH-106858)
Use PyModule_Add() or PyModule_AddObjectRef() instead of soft deprecated PyModule_AddObject().
This commit is contained in:
parent
f443b54a2f
commit
329e4a1a3f
29 changed files with 84 additions and 292 deletions
|
@ -5986,7 +5986,7 @@ sslmodule_init_constants(PyObject *m)
|
|||
#define addbool(m, key, value) \
|
||||
do { \
|
||||
PyObject *bool_obj = (value) ? Py_True : Py_False; \
|
||||
PyModule_AddObject((m), (key), Py_NewRef(bool_obj)); \
|
||||
PyModule_AddObjectRef((m), (key), bool_obj); \
|
||||
} while (0)
|
||||
|
||||
addbool(m, "HAS_SNI", 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue