[issue40413] Py_RunMain() crashes on subsequence call

STINNER Victor report at bugs.python.org
Tue Apr 28 08:46:11 EDT 2020


STINNER Victor <vstinner at python.org> added the comment:

I never tried, but I expect that the following pattern is fine:

for (i=0; i<5; i++) {
    Py_Initialize(); Py_RunMain()
}

Maybe Py_RunMain() must fail with a fatal error if it's called when Python is not initialized.

Since Py_RunMain() finalizes Python, you cannot call it multiple times without calling Py_Initialize() between calls.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40413>
_______________________________________


More information about the Python-bugs-list mailing list