Kumar Aditya <[email protected]> added the comment:
> Be careful, Python must remain usable after Py_Finalize(): it's legit to call
> Py_Initialize() again and execute new Python code. Example executing the same
> code 4 times, each time Py_Initialize() and Py_Finalize() are called:
./Programs/_testembed test_repeated_init_exec 'print("Hello")'
With the current design, it isn't possible though because the code objects are
modified in place so if co_quickened is freed the VM still tries to execute the
copied instructions.
See
https://github.com/python/cpython/blob/76dc047a0e88d10aad0405228d56e94438cdd91c/Python/specialize.c#L425
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46476>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com