summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-07-21 01:54:20 (GMT)
committerGitHub <noreply@github.com>2018-07-21 01:54:20 (GMT)
commitf2626ce6d4136f13a506e34ca8631ff2eab85fd9 (patch)
tree4ff9ea663d47622f013a6f42585641585471af43 /Include/internal
parentc884616390f990a58fe337376904530a48a0e833 (diff)
downloadcpython-f2626ce6d4136f13a506e34ca8631ff2eab85fd9.zip
cpython-f2626ce6d4136f13a506e34ca8631ff2eab85fd9.tar.gz
cpython-f2626ce6d4136f13a506e34ca8631ff2eab85fd9.tar.bz2
bpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged (GH-8361)
* _PyCoreConfig_Read() no longer directly modifies Py_IsolatedFlag and Py_NoSiteFlag global configuration flags. The function now requires two pointers to integer, so these flags can be set later, to avoid side effets in _PyCoreConfig_Read(). * pathconfig_global_init() now leaves Py_IsolatedFlag and Py_NoSiteFlag unchanged. * Fix pathconfig_global_init(): avoid computing the path configuration twice, use _PyCoreConfig_SetPathConfig().
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pystate.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h
index 83fa7dc..6cee272 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pystate.h
@@ -52,9 +52,17 @@ typedef struct _PyPathConfig {
wchar_t *program_name;
/* Set by Py_SetPythonHome() or PYTHONHOME environment variable */
wchar_t *home;
+ /* isolated and no_site_import are used to set Py_IsolatedFlag and
+ Py_NoSiteFlag flags on Windows in read_pth_file(). These fields
+ are ignored when their value are equal to -1 (unset). */
+ int isolated;
+ int no_site_import;
} _PyPathConfig;
-#define _PyPathConfig_INIT {.module_search_path = NULL}
+#define _PyPathConfig_INIT \
+ {.module_search_path = NULL, \
+ .isolated = -1, \
+ .no_site_import = -1}
/* Note: _PyPathConfig_INIT sets other fields to 0/NULL */
PyAPI_DATA(_PyPathConfig) _Py_path_config;