summaryrefslogtreecommitdiffstats
path: root/Lib/sysconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r--Lib/sysconfig.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index e0f9c18..cc8c796 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -125,9 +125,16 @@ def _is_python_source_dir(d):
return False
_sys_home = getattr(sys, '_home', None)
-if (_sys_home and os.name == 'nt' and
- _sys_home.lower().endswith(('\\pcbuild\\win32', '\\pcbuild\\amd64'))):
- _sys_home = os.path.dirname(os.path.dirname(_sys_home))
+
+if os.name == 'nt':
+ def _fix_pcbuild(d):
+ if d and os.path.normcase(d).startswith(
+ os.path.normcase(os.path.join(_PREFIX, "PCbuild"))):
+ return _PREFIX
+ return d
+ _PROJECT_BASE = _fix_pcbuild(_PROJECT_BASE)
+ _sys_home = _fix_pcbuild(_sys_home)
+
def is_python_build(check_home=False):
if check_home and _sys_home:
return _is_python_source_dir(_sys_home)