File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -396,9 +396,16 @@ Initializing and finalizing the interpreter
396
396
:c:func: `Py_NewInterpreter ` below) that were created and not yet destroyed since
397
397
the last call to :c:func:`Py_Initialize`. Ideally, this frees all memory
398
398
allocated by the Python interpreter. This is a no-op when called for a second
399
- time (without calling :c:func: `Py_Initialize ` again first). Normally the
400
- return value is ``0``. If there were errors during finalization
401
- (flushing buffered data), ``-1`` is returned.
399
+ time (without calling :c:func: `Py_Initialize ` again first).
400
+
401
+ Since this is the reverse of :c:func:`Py_Initialize`, it should be called
402
+ in the same thread with the same interpreter active. That means
403
+ the main thread and the main interpreter.
404
+ This should never be called while :c:func:`Py_RunMain` is running.
405
+
406
+ Normally the return value is ``0``.
407
+ If there were errors during finalization (flushing buffered data),
408
+ ``-1`` is returned.
402
409
403
410
This function is provided for a number of reasons. An embedding application
404
411
might want to restart Python without having to restart the application itself.
You can’t perform that action at this time.
0 commit comments