mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-34170: Add _PyCoreConfig._frozen parameter (GH-8591)
Modify frozenmain.c to use _Py_InitializeFromConfig().
This commit is contained in:
parent
8ed317f1ca
commit
b75d7e2435
7 changed files with 37 additions and 8 deletions
|
@ -41,7 +41,8 @@ Py_FrozenMain(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
Py_FrozenFlag = 1; /* Suppress errors from getpath.c */
|
||||
_PyCoreConfig config = _PyCoreConfig_INIT;
|
||||
config._frozen = 1; /* Suppress errors from getpath.c */
|
||||
|
||||
if ((p = Py_GETENV("PYTHONINSPECT")) && *p != '\0')
|
||||
inspect = 1;
|
||||
|
@ -80,7 +81,14 @@ Py_FrozenMain(int argc, char **argv)
|
|||
#endif /* MS_WINDOWS */
|
||||
if (argc >= 1)
|
||||
Py_SetProgramName(argv_copy[0]);
|
||||
Py_Initialize();
|
||||
|
||||
err = _Py_InitializeFromConfig(&config);
|
||||
/* No need to call _PyCoreConfig_Clear() since we didn't allocate any
|
||||
memory: program_name is a constant string. */
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
_Py_FatalInitError(err);
|
||||
}
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
PyWinFreeze_ExeInit();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue