Message411380
> 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 |
|
| Date |
User |
Action |
Args |
| 2022-01-23 15:52:24 | kumaraditya | set | recipients:
+ kumaraditya, gvanrossum, vstinner, Mark.Shannon, eric.snow, corona10 |
| 2022-01-23 15:52:24 | kumaraditya | set | messageid: <1642953144.6.0.00811454326365.issue46476@roundup.psfhosted.org> |
| 2022-01-23 15:52:24 | kumaraditya | link | issue46476 messages |
| 2022-01-23 15:52:24 | kumaraditya | create | |
|