https://github.com/python/cpython/commit/a975bea9b578beef9f979b3a527d324d791bef0d commit: a975bea9b578beef9f979b3a527d324d791bef0d branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: encukou <[email protected]> date: 2025-10-24T13:36:35Z summary:
[3.14] Document that PyModule_GetDef can return NULL with or without setting an exception (GH-140529) (GH-140545) (cherry picked from commit 289360ae63933c8956f87307ff091ec9ed19afed) Co-authored-by: Petr Viktorin <[email protected]> files: M Doc/c-api/module.rst diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index c8edcecc5b419f..1089bc34369fae 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -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) _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
