diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-08-01 00:13:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 00:13:04 (GMT) |
commit | b75d7e243512afcfb2285e6471262478383e09db (patch) | |
tree | a669ce23fbfe84ddbbb5b84ec0112df60ccf5f73 /Modules | |
parent | 8ed317f1ca42a43df14282bbc3ccc0b5610432f4 (diff) | |
download | cpython-b75d7e243512afcfb2285e6471262478383e09db.zip cpython-b75d7e243512afcfb2285e6471262478383e09db.tar.gz cpython-b75d7e243512afcfb2285e6471262478383e09db.tar.bz2 |
bpo-34170: Add _PyCoreConfig._frozen parameter (GH-8591)
Modify frozenmain.c to use _Py_InitializeFromConfig().
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/getpath.c | 6 | ||||
-rw-r--r-- | Modules/main.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c index 6d966e1..041cb14 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -372,7 +372,7 @@ calculate_prefix(const _PyCoreConfig *core_config, { calculate->prefix_found = search_for_prefix(core_config, calculate, prefix); if (!calculate->prefix_found) { - if (!Py_FrozenFlag) { + if (!core_config->_frozen) { fprintf(stderr, "Could not find platform independent libraries <prefix>\n"); } @@ -495,7 +495,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config, calculate, exec_prefix); if (!calculate->exec_prefix_found) { - if (!Py_FrozenFlag) { + if (!core_config->_frozen) { fprintf(stderr, "Could not find platform dependent libraries <exec_prefix>\n"); } @@ -915,7 +915,7 @@ calculate_path_impl(const _PyCoreConfig *core_config, calculate_exec_prefix(core_config, calculate, exec_prefix); if ((!calculate->prefix_found || !calculate->exec_prefix_found) && - !Py_FrozenFlag) + !core_config->_frozen) { fprintf(stderr, "Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]\n"); diff --git a/Modules/main.c b/Modules/main.c index 8000a1a..88e8262 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -573,6 +573,7 @@ _PyCoreConfig_GetGlobalConfig(_PyCoreConfig *config) COPY_FLAG(legacy_windows_fs_encoding, Py_LegacyWindowsFSEncodingFlag); COPY_FLAG(legacy_windows_stdio, Py_LegacyWindowsStdioFlag); #endif + COPY_FLAG(_frozen, Py_FrozenFlag); COPY_NOT_FLAG(use_environment, Py_IgnoreEnvironmentFlag); COPY_NOT_FLAG(site_import, Py_NoSiteFlag); @@ -759,6 +760,7 @@ _PyCoreConfig_Copy(_PyCoreConfig *config, const _PyCoreConfig *config2) COPY_ATTR(legacy_windows_stdio); #endif COPY_ATTR(_check_hash_pycs_mode); + COPY_ATTR(_frozen); #undef COPY_ATTR #undef COPY_STR_ATTR @@ -2281,6 +2283,9 @@ _PyCoreConfig_Read(_PyCoreConfig *config) if (config->utf8_mode < 0) { config->utf8_mode = 0; } + if (config->_frozen < 0) { + config->_frozen = 0; + } return _Py_INIT_OK(); } |