summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-03-22 20:47:04 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2020-04-15 12:37:03 -0700
commit99bb88aeadfd89d00d998b2e8809db85e0fd01a6 (patch)
treeadb6c9038eea4caf243bebccd3d9390157340039
parenta85cce05a172769e0c658ff530b106e2e6b20152 (diff)
downloadspack-99bb88aeadfd89d00d998b2e8809db85e0fd01a6.tar.gz
spack-99bb88aeadfd89d00d998b2e8809db85e0fd01a6.tar.bz2
spack-99bb88aeadfd89d00d998b2e8809db85e0fd01a6.tar.xz
spack-99bb88aeadfd89d00d998b2e8809db85e0fd01a6.zip
bugfix: TERM may not be in the environment on Cray (#15630)
-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