From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 20 Nov 2025 14:30:51 +0000 (+0100) Subject: [3.13] gh-141004: Document `Py_MakePendingCalls` (GH-141137) (GH-141788) X-Git-Tag: v3.13.10~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79e0f6f68449ce32c7b4d93f2f5b6243f225f2fd;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-141004: Document `Py_MakePendingCalls` (GH-141137) (GH-141788) gh-141004: Document `Py_MakePendingCalls` (GH-141137) (cherry picked from commit ce701032a3d5d3597466d5836ebe989db6eda2aa) Co-authored-by: Peter Bierma Co-authored-by: Victor Stinner --- diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index c2026922c703..a285c2467ae3 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -1964,6 +1964,25 @@ pointer and a void pointer argument. This function now always schedules *func* to be run in the main interpreter. + +.. c:function:: int Py_MakePendingCalls(void) + + Execute all pending calls. This is usually executed automatically by the + interpreter. + + This function returns ``0`` on success, and returns ``-1`` with an exception + set on failure. + + If this is not called in the main thread of the main + interpreter, this function does nothing and returns ``0``. + The caller must hold the :term:`GIL`. + + .. versionadded:: 3.1 + + .. versionchanged:: 3.12 + This function only runs pending calls in the main interpreter. + + .. _profiling: Profiling and Tracing