Skip to content

Commit 7b40979

Browse files
committed
gh-144257: document return values and failure conditions of PyModule_SetDocString
1 parent 7febbe6 commit 7b40979

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/c-api/module.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,10 @@ or code that creates modules dynamically.
10191019
Set the docstring for *module* to *docstring*.
10201020
This function is called automatically when creating a module from
10211021
``PyModuleDef`` (such as when using :ref:`multi-phase-initialization`,
1022-
``PyModule_Create``, or ``PyModule_FromDefAndSpec``).
1022+
``PyModule_Create``, or ``PyModule_FromDefAndSpec``). Returns ``0`` on
1023+
success and ``-1`` on failure. Failure can happen if creating a Python string
1024+
from *docstring* fails or if setting the ``__doc__`` attribute on *module*
1025+
fails.
10231026
10241027
.. versionadded:: 3.5
10251028

0 commit comments

Comments
 (0)