gh-134160: Use multi-phase init in documentation examples (#134296)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
neonene 2025-05-27 06:43:35 +09:00 committed by GitHub
parent 3c0525126e
commit 96905bdd27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 231 additions and 199 deletions

View file

@ -153,6 +153,6 @@ Allocating Objects on the Heap
.. seealso::
:c:func:`PyModule_Create`
:ref:`moduleobjects`
To allocate and create extension modules.

View file

@ -127,7 +127,7 @@ complete listing.
item defined in the module file. Example::
static struct PyModuleDef spam_module = {
PyModuleDef_HEAD_INIT,
.m_base = PyModuleDef_HEAD_INIT,
.m_name = "spam",
...
};
@ -135,7 +135,7 @@ complete listing.
PyMODINIT_FUNC
PyInit_spam(void)
{
return PyModule_Create(&spam_module);
return PyModuleDef_Init(&spam_module);
}