mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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
|
|
@ -82,8 +82,7 @@ main(int argc, char *argv[])
|
|||
/* Don't install importlib, since it could execute outdated bytecode. */
|
||||
config._install_importlib = 0;
|
||||
config.install_signal_handlers = 1;
|
||||
|
||||
Py_FrozenFlag++;
|
||||
config._frozen = 1;
|
||||
|
||||
_PyInitError err = _Py_InitializeFromConfig(&config);
|
||||
/* No need to call _PyCoreConfig_Clear() since we didn't allocate any
|
||||
|
|
|
|||
|
|
@ -368,6 +368,7 @@ dump_config(void)
|
|||
|
||||
printf("_install_importlib = %i\n", config->_install_importlib);
|
||||
printf("_check_hash_pycs_mode = %s\n", config->_check_hash_pycs_mode);
|
||||
printf("_frozen = %i\n", config->_frozen);
|
||||
|
||||
#undef ASSERT_EQUAL
|
||||
#undef ASSERT_STR_EQUAL
|
||||
|
|
@ -420,6 +421,8 @@ static int test_init_global_config(void)
|
|||
putenv("PYTHONUNBUFFERED=");
|
||||
Py_UnbufferedStdioFlag = 1;
|
||||
|
||||
Py_FrozenFlag = 1;
|
||||
|
||||
/* FIXME: test Py_LegacyWindowsFSEncodingFlag */
|
||||
/* FIXME: test Py_LegacyWindowsStdioFlag */
|
||||
|
||||
|
|
@ -525,6 +528,9 @@ static int test_init_from_config(void)
|
|||
|
||||
config._check_hash_pycs_mode = "always";
|
||||
|
||||
Py_FrozenFlag = 0;
|
||||
config._frozen = 1;
|
||||
|
||||
_PyInitError err = _Py_InitializeFromConfig(&config);
|
||||
/* Don't call _PyCoreConfig_Clear() since all strings are static */
|
||||
if (_Py_INIT_FAILED(err)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue