bpo-36900: Replace global conf vars with config (GH-13299)

Replace global configuration variables with core_config read from the
current interpreter.

Cleanup dynload_hpux.c.
This commit is contained in:
Victor Stinner 2019-05-14 17:34:56 +02:00 committed by GitHub
parent 3c93153f7d
commit c96be811fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 37 deletions

View file

@ -150,12 +150,13 @@ init_importlib(PyInterpreterState *interp, PyObject *sysmod)
PyObject *importlib;
PyObject *impmod;
PyObject *value;
int verbose = interp->core_config.verbose;
/* Import _importlib through its frozen version, _frozen_importlib. */
if (PyImport_ImportFrozenModule("_frozen_importlib") <= 0) {
return _Py_INIT_ERR("can't import _frozen_importlib");
}
else if (Py_VerboseFlag) {
else if (verbose) {
PySys_FormatStderr("import _frozen_importlib # frozen\n");
}
importlib = PyImport_AddModule("_frozen_importlib");
@ -175,7 +176,7 @@ init_importlib(PyInterpreterState *interp, PyObject *sysmod)
if (impmod == NULL) {
return _Py_INIT_ERR("can't import _imp");
}
else if (Py_VerboseFlag) {
else if (verbose) {
PySys_FormatStderr("import _imp # builtin\n");
}
if (_PyImport_SetModuleString("_imp", impmod) < 0) {