summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-03-30 16:04:45 (GMT)
committerGitHub <noreply@github.com>2020-03-30 16:04:45 (GMT)
commit676b105111e2399ed400cd13ab113f9aa891760d (patch)
tree1a89af60a005e6829ec3d99535f2a03cf6162563 /PC
parent53e4c91725083975598350877e2ed8e2d0194114 (diff)
downloadcpython-676b105111e2399ed400cd13ab113f9aa891760d.zip
cpython-676b105111e2399ed400cd13ab113f9aa891760d.tar.gz
cpython-676b105111e2399ed400cd13ab113f9aa891760d.tar.bz2
bpo-8901: Windows registry path is now ignored with the -E option (GH-18169)
Diffstat (limited to 'PC')
-rw-r--r--PC/getpathp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 7a2c1fd..aa820e5 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -783,8 +783,11 @@ calculate_module_search_path(PyCalculatePath *calculate,
{
int skiphome = calculate->home==NULL ? 0 : 1;
#ifdef Py_ENABLE_SHARED
- calculate->machine_path = getpythonregpath(HKEY_LOCAL_MACHINE, skiphome);
- calculate->user_path = getpythonregpath(HKEY_CURRENT_USER, skiphome);
+ if (!Py_IgnoreEnvironmentFlag) {
+ calculate->machine_path = getpythonregpath(HKEY_LOCAL_MACHINE,
+ skiphome);
+ calculate->user_path = getpythonregpath(HKEY_CURRENT_USER, skiphome);
+ }
#endif
/* We only use the default relative PYTHONPATH if we haven't
anything better to use! */