summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/platforms/cray.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/spack/spack/platforms/cray.py b/lib/spack/spack/platforms/cray.py
index 8eae51e66a..6e8c79ef0c 100644
--- a/lib/spack/spack/platforms/cray.py
+++ b/lib/spack/spack/platforms/cray.py
@@ -117,9 +117,13 @@ class Cray(Platform):
'''
# env -i /bin/bash -lc echo $CRAY_CPU_TARGET 2> /dev/null
if getattr(self, 'default', None) is None:
- output = Executable('/bin/bash')('-lc', 'echo $CRAY_CPU_TARGET',
- env={'TERM': os.environ['TERM']},
- output=str, error=os.devnull)
+ bash = Executable('/bin/bash')
+ output = bash(
+ '-lc', 'echo $CRAY_CPU_TARGET',
+ env={'TERM': os.environ.get('TERM', '')},
+ output=str,
+ error=os.devnull
+ )
output = ''.join(output.split()) # remove all whitespace
if output:
self.default = output