]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document that PyModule_GetDef can return NULL with or without setting an exception...
authorPetr Viktorin <encukou@gmail.com>
Fri, 24 Oct 2025 13:28:48 +0000 (15:28 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Oct 2025 13:28:48 +0000 (15:28 +0200)
Doc/c-api/module.rst

index 29d5cd8d5391a392b078bdd2c355d92e128ed8ca..6626f628fcc47f5dbdbc124ebae456b06b5d0fe9 100644 (file)
@@ -102,6 +102,10 @@ Module Objects
    Return a pointer to the :c:type:`PyModuleDef` struct from which the module was
    created, or ``NULL`` if the module wasn't created from a definition.
 
+   On error, return ``NULL`` with an exception set.
+   Use :c:func:`PyErr_Occurred` to tell this case apart from a mising
+   :c:type:`!PyModuleDef`.
+
 
 .. c:function:: PyObject* PyModule_GetFilenameObject(PyObject *module)