diff options
-rw-r--r-- | lib/spack/spack/detection/common.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/spack/detection/common.py b/lib/spack/spack/detection/common.py index 8cb9d7d3ac..3e9856766f 100644 --- a/lib/spack/spack/detection/common.py +++ b/lib/spack/spack/detection/common.py @@ -218,8 +218,10 @@ def update_configuration(detected_packages, scope=None, buildable=True): def _windows_drive(): - """Return Windows drive string""" - return os.environ["HOMEDRIVE"] + """Return Windows drive string extracted from PROGRAMFILES + env var, which is garunteed to be defined for all logins""" + drive = re.match(r"([a-zA-Z]:)", os.environ["PROGRAMFILES"]).group(1) + return drive class WindowsCompilerExternalPaths(object): |