summaryrefslogtreecommitdiffstats
path: root/PC/getpathp.c
diff options
context:
space:
mode:
Diffstat (limited to 'PC/getpathp.c')
-rw-r--r--PC/getpathp.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index fa687b7..df4cb0a 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -553,8 +553,7 @@ get_program_full_path(const _PyCoreConfig *core_config,
static int
-read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path,
- int *isolated, int *nosite)
+read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path)
{
FILE *sp_file = _Py_wfopen(path, L"r");
if (sp_file == NULL) {
@@ -563,8 +562,8 @@ read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path,
wcscpy_s(prefix, MAXPATHLEN+1, path);
reduce(prefix);
- *isolated = 1;
- *nosite = 1;
+ config->isolated = 1;
+ config->no_site_import = 1;
size_t bufsiz = MAXPATHLEN;
size_t prefixlen = wcslen(prefix);
@@ -589,9 +588,10 @@ read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path,
}
if (strcmp(line, "import site") == 0) {
- *nosite = 0;
+ config->no_site_import = 0;
continue;
- } else if (strncmp(line, "import ", 7) == 0) {
+ }
+ else if (strncmp(line, "import ", 7) == 0) {
Py_FatalError("only 'import site' is supported in ._pth file");
}
@@ -680,11 +680,7 @@ calculate_pth_file(_PyPathConfig *config, wchar_t *prefix)
return 0;
}
- /* FIXME, bpo-32030: Global configuration variables should not be modified
- here, _PyPathConfig_Init() is called early in Python initialization:
- see pymain_cmdline(). */
- return read_pth_file(config, prefix, spbuffer,
- &Py_IsolatedFlag, &Py_NoSiteFlag);
+ return read_pth_file(config, prefix, spbuffer);
}