Skip to content

Commit a975bea

Browse files
[3.14] Document that PyModule_GetDef can return NULL with or without setting an exception (pythonGH-140529) (pythonGH-140545)
(cherry picked from commit 289360a) Co-authored-by: Petr Viktorin <[email protected]>
1 parent 4bb2f1f commit a975bea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/c-api/module.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ Module Objects
102102
Return a pointer to the :c:type:`PyModuleDef` struct from which the module was
103103
created, or ``NULL`` if the module wasn't created from a definition.
104104
105+
On error, return ``NULL`` with an exception set.
106+
Use :c:func:`PyErr_Occurred` to tell this case apart from a mising
107+
:c:type:`!PyModuleDef`.
108+
105109
106110
.. c:function:: PyObject* PyModule_GetFilenameObject(PyObject *module)
107111

0 commit comments

Comments
 (0)