diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-09-26 00:22:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-26 00:22:35 (GMT) |
commit | 8bf39b606ef7b02c0279a80789f3c4824b0da5e9 (patch) | |
tree | 03064cc01948ed71ddf760e951436507f621d306 /Include | |
parent | df69e75edcc08475bc9a57a5a76df8a45bfc3c34 (diff) | |
download | cpython-8bf39b606ef7b02c0279a80789f3c4824b0da5e9.zip cpython-8bf39b606ef7b02c0279a80789f3c4824b0da5e9.tar.gz cpython-8bf39b606ef7b02c0279a80789f3c4824b0da5e9.tar.bz2 |
bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)
* Add test_embed.test_init_setpath_config(): test Py_SetPath()
with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import and base_executable
fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
calculated base_executable: _PyConfig_InitPathConfig() copies
executable to base_executable.
* Complete path config documentation.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_pathconfig.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index 61b3790..b5d1144 100644 --- a/Include/internal/pycore_pathconfig.h +++ b/Include/internal/pycore_pathconfig.h @@ -19,6 +19,7 @@ typedef struct _PyPathConfig { wchar_t *program_name; /* Set by Py_SetPythonHome() or PYTHONHOME environment variable */ wchar_t *home; +#ifdef MS_WINDOWS /* isolated and 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). */ @@ -26,12 +27,18 @@ typedef struct _PyPathConfig { int site_import; /* Set when a venv is detected */ wchar_t *base_executable; +#endif } _PyPathConfig; -#define _PyPathConfig_INIT \ - {.module_search_path = NULL, \ - .isolated = -1, \ - .site_import = -1} +#ifdef MS_WINDOWS +# define _PyPathConfig_INIT \ + {.module_search_path = NULL, \ + .isolated = -1, \ + .site_import = -1} +#else +# define _PyPathConfig_INIT \ + {.module_search_path = NULL} +#endif /* Note: _PyPathConfig_INIT sets other fields to 0/NULL */ PyAPI_DATA(_PyPathConfig) _Py_path_config; |