bpo-36763: Add _Py_InitializeMain()#13362
Conversation
* Add again _PyCoreConfig._init_main * _PyCoreConfig: rename _frozen to pathconfig_warnings, its value is not the opposite of Py_FrozenFlag. * Add an unit test for _init_main=0 and _Py_InitializeMain()
|
@zooba @Yhg1s @ncoghlan: Ok, here you have, a simple change to allow to execute Python code between _Py_InitializeFromConfig() and _Py_InitializeMain(). Using a small change in run_eval_code_obj() (set builtins in globals), it becomes even possible to use import before _Py_InitializeMain() ;-) See included unit test: Maybe _Py_InitializeMain() can be added to PEP 587 as an experimental feature until we decide how to implement PEP 432. |
Sorry, something went wrong.
|
I merge this PR right now, because it fix a _Py_InitializeFromConfig() bug. _Py_InitializeMainInterpreter() must be called even if pathconfig_warnings is 0. pathconfig_warnings and _init_main must not be related. I was wrong when I removed _PyCoreConfig._init_main. |
Sorry, something went wrong.
not the opposite of Py_FrozenFlag.
https://bugs.python.org/issue36763