]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Document that PyModule_GetDef can return NULL with or without setting an excep...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 24 Oct 2025 13:36:35 +0000 (15:36 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Oct 2025 13:36:35 +0000 (13:36 +0000)
(cherry picked from commit 289360ae63933c8956f87307ff091ec9ed19afed)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/c-api/module.rst

index c8edcecc5b419f33bf7bf0c657d1f9a7ea457bb7..1089bc34369fae036572087adb1f99199eacdf70 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)