diff options
author | Steve Dower <steve.dower@microsoft.com> | 2019-02-05 01:15:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-05 01:15:13 (GMT) |
commit | 85e102a2b090dd693d0801ae2edb9660cfa0f281 (patch) | |
tree | 0735adb3d875561dd3f6f266253db336fb122788 /Lib/sysconfig.py | |
parent | 69091cb497b2f0fe7e2789b30b43cf78caf9de9b (diff) | |
download | cpython-85e102a2b090dd693d0801ae2edb9660cfa0f281.zip cpython-85e102a2b090dd693d0801ae2edb9660cfa0f281.tar.gz cpython-85e102a2b090dd693d0801ae2edb9660cfa0f281.tar.bz2 |
bpo-35299: Fixed sysconfig and distutils during PGO profiling (GH-11744)
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 13 |
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) |