mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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:
parent
14d5331eb5
commit
da7933ecc3
19 changed files with 90 additions and 64 deletions
|
@ -301,7 +301,7 @@ pymain_run_module(const wchar_t *modname, int set_argv0)
|
|||
|
||||
|
||||
static int
|
||||
pymain_run_file(PyConfig *config, PyCompilerFlags *cf)
|
||||
pymain_run_file(const PyConfig *config, PyCompilerFlags *cf)
|
||||
{
|
||||
const wchar_t *filename = config->run_filename;
|
||||
if (PySys_Audit("cpython.run_file", "u", filename) < 0) {
|
||||
|
@ -499,7 +499,7 @@ pymain_run_python(int *exitcode)
|
|||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
|
||||
/* pymain_run_stdin() modify the config */
|
||||
PyConfig *config = &interp->config;
|
||||
PyConfig *config = (PyConfig*)_PyInterpreterState_GetConfig(interp);
|
||||
|
||||
PyObject *main_importer_path = NULL;
|
||||
if (config->run_filename != NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue