diff options
author | Levi Baber <baber@iastate.edu> | 2019-05-02 11:04:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 11:04:21 -0500 |
commit | 9e72fc48c81bb31017912bb0376530cbfa89d989 (patch) | |
tree | 8ed274c4197e720dd98d06b5701c8278e4eb0992 | |
parent | 309122c3293733dbcb140765a8e0e7f6d1098691 (diff) | |
download | spack-9e72fc48c81bb31017912bb0376530cbfa89d989.tar.gz spack-9e72fc48c81bb31017912bb0376530cbfa89d989.tar.bz2 spack-9e72fc48c81bb31017912bb0376530cbfa89d989.tar.xz spack-9e72fc48c81bb31017912bb0376530cbfa89d989.zip |
fix error when adding package to env in container (#11321)
-rw-r--r-- | lib/spack/spack/environment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 62cad8545c..02b0a6d93c 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -125,7 +125,7 @@ def activate( cmds += 'setenv SPACK_OLD_PROMPT "${prompt}";\n' cmds += 'set prompt="%s ${prompt}";\n' % prompt else: - if 'color' in os.environ['TERM'] and prompt: + if os.getenv('TERM') and 'color' in os.getenv('TERM') and prompt: prompt = colorize('@G{%s} ' % prompt, color=True) cmds += 'export SPACK_ENV=%s;\n' % env.path |