bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of frozen modules. (gh-28320)

Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file.  This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now.

https://bugs.python.org/issue45020
This commit is contained in:
Eric Snow 2021-09-14 17:31:45 -06:00 committed by GitHub
parent 1aaa859497
commit a65c86889e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 359 additions and 117 deletions

View file

@ -1078,8 +1078,8 @@ init_interp_main(PyThreadState *tstate)
return _PyStatus_OK();
}
// Compute the path configuration
status = _PyConfig_InitPathConfig(&interp->config, 1);
// Initialize the import-related configuration.
status = _PyConfig_InitImportConfig(&interp->config);
if (_PyStatus_EXCEPTION(status)) {
return status;
}