Skip to content

Commit 91d9a50

Browse files
committed
Fix some warnings
1 parent 394e814 commit 91d9a50

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Doc/c-api/extension-modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ item defined in the module's C source.
8585

8686
The hook should be kept short -- ideally, one line as above.
8787
If you do need to use Python C API in this function, it is recommended to call
88-
:c:expr:`PyABIInfo_Check(&abi_info, "modulename")` first to raise an exception,
88+
``PyABIInfo_Check(&abi_info, "modulename")`` first to raise an exception,
8989
rather than crash, in common cases of ABI mismatch.
9090

9191

@@ -335,7 +335,7 @@ in the following ways:
335335
* Attempts to import a single-phase initialization module reentrantly
336336
from its own initialization function are likely to cause infinite recursion.
337337
(The extension author may prevent this by manually inserting a partially
338-
initialized module object in `sys.modules`.)
338+
initialized module object in :py:attr:`sys.modules`.)
339339

340340
* Non-ASCII module names (``PyInitU_modulename``) are not supported.
341341

Doc/c-api/module.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ To retrieve the state from a given module, use the following functions:
533533
534534
Return the "state" of the module, that is, a pointer to the block of memory
535535
allocated at module creation time, or ``NULL``. See
536-
:c:macro:`Py_mod_size`.
536+
:c:macro:`Py_mod_state_size`.
537537
538538
On error, return ``NULL`` with an exception set.
539539
Use :c:func:`PyErr_Occurred` to tell this case apart from a missing
@@ -543,7 +543,7 @@ To retrieve the state from a given module, use the following functions:
543543
.. c:function:: int PyModule_GetStateSize(PyObject *, Py_ssize_t *result)
544544
545545
Set *\*result* to the size of the module's state, as specified using
546-
:c:macro:`Py_mod_size` (or :c:member:`PyModuleDef.m_size`),
546+
:c:macro:`Py_mod_state_size` (or :c:member:`PyModuleDef.m_size`),
547547
and return 0.
548548
549549
On error, set *\*result* to -1, and return -1 with an exception set.
@@ -681,7 +681,17 @@ remove it.
681681
682682
.. c:member:: PyModuleDef_Base m_base
683683
684-
Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`.
684+
Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`:
685+
686+
.. c:namespace:: NULL
687+
688+
.. c:type:: PyModuleDef_Base
689+
690+
The type of :c:member:`!PyModuleDef.m_base`.
691+
692+
.. c:macro:: PyModuleDef_HEAD_INIT
693+
694+
The required initial value for :c:member:`!PyModuleDef.m_base`.
685695
686696
.. c:member:: const char *m_name
687697
const char *m_doc
@@ -734,6 +744,7 @@ remove it.
734744
:c:member:`!m_traverse`, :c:member:`m_clear` and :c:member:`m_free`
735745
functions are longer called before the module state is allocated.
736746

747+
737748
.. _moduledef-dynamic:
738749

739750
The following API can be used to create modules from a :c:type:`!PyModuleDef`

0 commit comments

Comments
 (0)