@@ -373,6 +373,14 @@ Initializing and finalizing the interpreter
373373 :c:func:`Py_Initialize` is called again.
374374
375375
376+ .. c:function:: int Py_IsFinalizing()
377+
378+ Return true (non-zero) if the main Python interpreter is
379+ :term:`shutting down <interpreter shutdown>`. Return false (zero) otherwise.
380+
381+ .. versionadded:: 3.13
382+
383+
376384.. c:function:: int Py_FinalizeEx()
377385
378386 Undo all initializations made by :c:func:`Py_Initialize` and subsequent use of
@@ -852,7 +860,7 @@ code, or when embedding the Python interpreter:
852860 .. note::
853861 Calling this function from a thread when the runtime is finalizing
854862 will terminate the thread, even if the thread was not created by Python.
855- You can use :c:func:`!_Py_IsFinalizing ` or :func:`sys.is_finalizing` to
863+ You can use :c:func:`Py_IsFinalizing ` or :func:`sys.is_finalizing` to
856864 check if the interpreter is in process of being finalized before calling
857865 this function to avoid unwanted termination.
858866
@@ -898,7 +906,7 @@ with sub-interpreters:
898906 .. note::
899907 Calling this function from a thread when the runtime is finalizing
900908 will terminate the thread, even if the thread was not created by Python.
901- You can use :c:func:`!_Py_IsFinalizing ` or :func:`sys.is_finalizing` to
909+ You can use :c:func:`Py_IsFinalizing ` or :func:`sys.is_finalizing` to
902910 check if the interpreter is in process of being finalized before calling
903911 this function to avoid unwanted termination.
904912
@@ -1180,7 +1188,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
11801188 .. note::
11811189 Calling this function from a thread when the runtime is finalizing
11821190 will terminate the thread, even if the thread was not created by Python.
1183- You can use :c:func:`!_Py_IsFinalizing ` or :func:`sys.is_finalizing` to
1191+ You can use :c:func:`Py_IsFinalizing ` or :func:`sys.is_finalizing` to
11841192 check if the interpreter is in process of being finalized before calling
11851193 this function to avoid unwanted termination.
11861194
0 commit comments