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()
This commit is contained in:
Victor Stinner 2020-04-13 03:04:28 +02:00 committed by GitHub
parent 14d5331eb5
commit da7933ecc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 90 additions and 64 deletions

View file

@ -2595,7 +2595,7 @@ _Py_GetConfigsAsDict(void)
Py_CLEAR(dict);
/* core config */
const PyConfig *config = &tstate->interp->config;
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
dict = config_as_dict(config);
if (dict == NULL) {
goto error;
@ -2662,7 +2662,7 @@ _Py_DumpPathConfig(PyThreadState *tstate)
PySys_WriteStderr("\n"); \
} while (0)
PyConfig *config = &tstate->interp->config;
const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp);
DUMP_CONFIG("PYTHONHOME", home);
DUMP_CONFIG("PYTHONPATH", pythonpath_env);
DUMP_CONFIG("program name", program_name);