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
|
# env -i /bin/bash -lc echo $CRAY_CPU_TARGET 2> /dev/null
|
||||||
if getattr(self, 'default', None) is None:
|
if getattr(self, 'default', None) is None:
|
||||||
output = Executable('/bin/bash')('-lc', 'echo $CRAY_CPU_TARGET',
|
bash = Executable('/bin/bash')
|
||||||
env={'TERM': os.environ['TERM']},
|
output = bash(
|
||||||
output=str, error=os.devnull)
|
'-lc', 'echo $CRAY_CPU_TARGET',
|
||||||
|
env={'TERM': os.environ.get('TERM', '')},
|
||||||
|
output=str,
|
||||||
|
error=os.devnull
|
||||||
|
)
|
||||||
output = ''.join(output.split()) # remove all whitespace
|
output = ''.join(output.split()) # remove all whitespace
|
||||||
if output:
|
if output:
|
||||||
self.default = output
|
self.default = output
|
||||||
|
Loading…
Reference in New Issue
Block a user