summaryrefslogtreecommitdiffstats
path: root/Include/pystate.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-14 01:20:52 (GMT)
committerGitHub <noreply@github.com>2017-12-14 01:20:52 (GMT)
commitb5fd9ad05e0f15f8272b8f1b829af22077230584 (patch)
tree14c128a5e3b71864726d6fae4a414883ce6b9440 /Include/pystate.h
parent176baa326be4ec2dc70ca0c054b7e2ab7ca6a9cf (diff)
downloadcpython-b5fd9ad05e0f15f8272b8f1b829af22077230584.zip
cpython-b5fd9ad05e0f15f8272b8f1b829af22077230584.tar.gz
cpython-b5fd9ad05e0f15f8272b8f1b829af22077230584.tar.bz2
bpo-32030: Rewrite _PyMainInterpreterConfig (#4854)
_PyMainInterpreterConfig now contains Python objects, whereas _PyCoreConfig contains wchar_t* strings. Core config: * Rename _PyMainInterpreterConfig_ReadEnv() to _PyCoreConfig_ReadEnv() * Move 3 strings from _PyMainInterpreterConfig to _PyCoreConfig: module_search_path_env, home, program_name. * Add _PyCoreConfig_Clear() * _PyPathConfig_Calculate() now takes core config rather than main config * _PyMainInterpreterConfig_Read() now requires also a core config Main config: * Add _PyMainInterpreterConfig.module_search_path: sys.path list * Add _PyMainInterpreterConfig.argv: sys.argv list * _PyMainInterpreterConfig_Read() now computes module_search_path
Diffstat (limited to 'Include/pystate.h')
-rw-r--r--Include/pystate.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/Include/pystate.h b/Include/pystate.h
index c7ea179..9a26cc3 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -39,6 +39,11 @@ typedef struct {
int dump_refs; /* PYTHONDUMPREFS */
int malloc_stats; /* PYTHONMALLOCSTATS */
int utf8_mode; /* -X utf8 or PYTHONUTF8 environment variable */
+
+ wchar_t *module_search_path_env; /* PYTHONPATH environment variable */
+ wchar_t *home; /* PYTHONHOME environment variable,
+ see also Py_SetPythonHome(). */
+ wchar_t *program_name; /* Program name, see also Py_GetProgramName() */
} _PyCoreConfig;
#define _PyCoreConfig_INIT (_PyCoreConfig){.use_hash_seed = -1}
@@ -52,12 +57,8 @@ typedef struct {
*/
typedef struct {
int install_signal_handlers;
- /* PYTHONPATH environment variable */
- wchar_t *module_search_path_env;
- /* PYTHONHOME environment variable, see also Py_SetPythonHome(). */
- wchar_t *home;
- /* Program name, see also Py_GetProgramName() */
- wchar_t *program_name;
+ PyObject *argv; /* sys.argv list, can be NULL */
+ PyObject *module_search_path; /* sys.path list */
} _PyMainInterpreterConfig;
#define _PyMainInterpreterConfig_INIT \