summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2020-03-22 20:47:04 -0700
committerGitHub <noreply@github.com>2020-03-22 20:47:04 -0700
commit0323f84e790c34d8e33672280ad0817b05abe90c (patch)
tree6e59bd7f9ea4b26a71e875f2af0caba99747bd84 /lib
parentd9c5b7de103321f104fc19019caee6d421cd3c59 (diff)
downloadspack-0323f84e790c34d8e33672280ad0817b05abe90c.tar.gz
spack-0323f84e790c34d8e33672280ad0817b05abe90c.tar.bz2
spack-0323f84e790c34d8e33672280ad0817b05abe90c.tar.xz
spack-0323f84e790c34d8e33672280ad0817b05abe90c.zip
bugfix: TERM may not be in the environment on Cray (#15630)
Diffstat (limited to 'lib')
-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