summaryrefslogtreecommitdiff
path: root/Include/pystate.h
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-23 00:12:09 +0100
committerGitHub <noreply@github.com>2017-11-23 00:12:09 +0100
commitd4341109746aa15e1909e63b30b93b6133ffe401 (patch)
tree8982cc677ace3953484d4e4e34c8b154d0b9fb35 /Include/pystate.h
parent82656276caf4cb889193572d2d14dbc5f3d2bdff (diff)
downloadcpython-git-d4341109746aa15e1909e63b30b93b6133ffe401.tar.gz
bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)
Changes: * Py_Main() initializes _PyCoreConfig.module_search_path_env from the PYTHONPATH environment variable. * PyInterpreterState_New() now initializes core_config and config fields * Compute sys.path a little bit ealier in _Py_InitializeMainInterpreter() and new_interpreter() * Add _Py_GetPathWithConfig() private function.
Diffstat (limited to 'Include/pystate.h')
-rw-r--r--Include/pystate.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Include/pystate.h b/Include/pystate.h
index a3840c96cb..c5d3c3345f 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -30,6 +30,7 @@ typedef struct {
unsigned long hash_seed;
int _disable_importlib; /* Needed by freeze_importlib */
const char *allocator; /* Memory allocator: _PyMem_SetupAllocators() */
+ wchar_t *module_search_path_env; /* PYTHONPATH environment variable */
int dev_mode; /* -X dev */
int faulthandler; /* -X faulthandler */
int tracemalloc; /* -X tracemalloc=N */
@@ -39,11 +40,13 @@ typedef struct {
} _PyCoreConfig;
#define _PyCoreConfig_INIT \
- {.ignore_environment = 0, \
+ (_PyCoreConfig){\
+ .ignore_environment = 0, \
.use_hash_seed = -1, \
.hash_seed = 0, \
._disable_importlib = 0, \
.allocator = NULL, \
+ .module_search_path_env = NULL, \
.dev_mode = 0, \
.faulthandler = 0, \
.tracemalloc = 0, \
@@ -61,7 +64,9 @@ typedef struct {
int install_signal_handlers;
} _PyMainInterpreterConfig;
-#define _PyMainInterpreterConfig_INIT {-1}
+#define _PyMainInterpreterConfig_INIT \
+ (_PyMainInterpreterConfig){\
+ .install_signal_handlers = -1}
typedef struct _is {