@@ -373,6 +373,14 @@ Initializing and finalizing the interpreter
373
373
:c:func:`Py_Initialize` is called again.
374
374
375
375
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
+
376
384
.. c:function:: int Py_FinalizeEx()
377
385
378
386
Undo all initializations made by :c:func:`Py_Initialize` and subsequent use of
@@ -852,7 +860,7 @@ code, or when embedding the Python interpreter:
852
860
.. note::
853
861
Calling this function from a thread when the runtime is finalizing
854
862
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
856
864
check if the interpreter is in process of being finalized before calling
857
865
this function to avoid unwanted termination.
858
866
@@ -898,7 +906,7 @@ with sub-interpreters:
898
906
.. note::
899
907
Calling this function from a thread when the runtime is finalizing
900
908
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
902
910
check if the interpreter is in process of being finalized before calling
903
911
this function to avoid unwanted termination.
904
912
@@ -1180,7 +1188,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
1180
1188
.. note::
1181
1189
Calling this function from a thread when the runtime is finalizing
1182
1190
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
1184
1192
check if the interpreter is in process of being finalized before calling
1185
1193
this function to avoid unwanted termination.
1186
1194
0 commit comments