summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-13 01:04:28 (GMT)
committerGitHub <noreply@github.com>2020-04-13 01:04:28 (GMT)
commitda7933ecc30e37b119756cb02b89a6ad99db22e0 (patch)
treee6c7227f2ded7b7354fb027342fa977f70808d10 /Python/import.c
parent14d5331eb5e6c38be12bad421bd59ad0fac9e448 (diff)
downloadcpython-da7933ecc30e37b119756cb02b89a6ad99db22e0.zip
cpython-da7933ecc30e37b119756cb02b89a6ad99db22e0.tar.gz
cpython-da7933ecc30e37b119756cb02b89a6ad99db22e0.tar.bz2
bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492)
Don't access PyInterpreterState.config member directly anymore, but use new functions: * _PyInterpreterState_GetConfig() * _PyInterpreterState_SetConfig() * _Py_GetConfig()
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/import.c b/Python/import.c
index 2e43456..d79fa18 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -102,7 +102,7 @@ _PyImportZip_Init(PyThreadState *tstate)
goto error;
}
- int verbose = tstate->interp->config.verbose;
+ int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose;
if (verbose) {
PySys_WriteStderr("# installing zipimport hook\n");
}
@@ -446,7 +446,7 @@ _PyImport_Cleanup(PyThreadState *tstate)
/* XXX Perhaps these precautions are obsolete. Who knows? */
- int verbose = interp->config.verbose;
+ int verbose = _PyInterpreterState_GetConfig(interp)->verbose;
if (verbose) {
PySys_WriteStderr("# clear builtins._\n");
}
@@ -811,7 +811,7 @@ import_find_extension(PyThreadState *tstate, PyObject *name,
return NULL;
}
- int verbose = tstate->interp->config.verbose;
+ int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose;
if (verbose) {
PySys_FormatStderr("import %U # previously loaded (%R)\n",
name, filename);
@@ -1523,7 +1523,7 @@ remove_importlib_frames(PyThreadState *tstate)
which end with a call to "_call_with_frames_removed". */
_PyErr_Fetch(tstate, &exception, &value, &base_tb);
- if (!exception || tstate->interp->config.verbose) {
+ if (!exception || _PyInterpreterState_GetConfig(tstate->interp)->verbose) {
goto done;
}
@@ -1727,7 +1727,7 @@ import_find_and_load(PyThreadState *tstate, PyObject *abs_name)
_Py_IDENTIFIER(_find_and_load);
PyObject *mod = NULL;
PyInterpreterState *interp = tstate->interp;
- int import_time = interp->config.import_time;
+ int import_time = _PyInterpreterState_GetConfig(interp)->import_time;
static int import_level;
static _PyTime_t accumulated;
@@ -2413,7 +2413,7 @@ PyInit__imp(void)
goto failure;
}
- const wchar_t *mode = _PyInterpreterState_GET_UNSAFE()->config.check_hash_pycs_mode;
+ const wchar_t *mode = _Py_GetConfig()->check_hash_pycs_mode;
PyObject *pyc_mode = PyUnicode_FromWideChar(mode, -1);
if (pyc_mode == NULL) {
goto failure;