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 @@ -388,9 +388,16 @@ Initializing and finalizing the interpreter
388
388
:c:func: `Py_NewInterpreter ` below) that were created and not yet destroyed since
389
389
the last call to :c:func:`Py_Initialize`. Ideally, this frees all memory
390
390
allocated by the Python interpreter. This is a no-op when called for a second
391
- time (without calling :c:func: `Py_Initialize ` again first). Normally the
392
- return value is ``0``. If there were errors during finalization
393
- (flushing buffered data), ``-1`` is returned.
391
+ time (without calling :c:func: `Py_Initialize ` again first).
392
+
393
+ Since this is the reverse of :c:func:`Py_Initialize`, it should be called
394
+ in the same thread with the same interpreter active. That means
395
+ the main thread and the main interpreter.
396
+ This should never be called while :c:func:`Py_RunMain` is running.
397
+
398
+ Normally the return value is ``0``.
399
+ If there were errors during finalization (flushing buffered data),
400
+ ``-1`` is returned.
394
401
395
402
This function is provided for a number of reasons. An embedding application
396
403
might want to restart Python without having to restart the application itself.
You can’t perform that action at this time.
0 commit comments