bugfix: TERM may not be in the environment on Cray (#15630)
This commit is contained in:
parent
d9c5b7de10
commit
0323f84e79
@ -117,9 +117,13 @@ def _default_target_from_env(self):
|
||||
'''
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user