diff --git a/lib/spack/spack/util/shell_detection.py b/lib/spack/spack/util/shell_detection.py index 7af72f87028..a6d6062e6a5 100644 --- a/lib/spack/spack/util/shell_detection.py +++ b/lib/spack/spack/util/shell_detection.py @@ -17,7 +17,10 @@ def active_shell_type(env=os.environ): else: try: output = subprocess.run( - 'powershell -Command "echo $PSVersionTable"', shell=True, check=True, text=True + 'powershell -Command "echo $PSVersionTable"', + shell=True, + check=True, + universal_newlines=True, ) if "PSVersion" in output: return "ps1"