summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-07-31 17:53:09 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-08-01 17:40:54 -0700
commit44ce0adbd5b0b0356b4fe0977dc627f589278291 (patch)
tree072b1cde0dec21da5a0c0186d0d086326af601fc /lib
parentb88f55e523590d33b03b0d90f2a2d0875f4c60cb (diff)
downloadspack-44ce0adbd5b0b0356b4fe0977dc627f589278291.tar.gz
spack-44ce0adbd5b0b0356b4fe0977dc627f589278291.tar.bz2
spack-44ce0adbd5b0b0356b4fe0977dc627f589278291.tar.xz
spack-44ce0adbd5b0b0356b4fe0977dc627f589278291.zip
Fix color bug in Spec.format() introduced by #3013
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/spec.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 71d9f4aac1..54939d7a6b 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -2706,11 +2706,8 @@ class Spec(object):
named_str = fmt = ''
def write(s, c):
- if color:
- f = color_formats[c] + cescape(s) + '@.'
- cwrite(f, stream=out, color=color)
- else:
- out.write(s)
+ f = color_formats[c] + cescape(s) + '@.'
+ cwrite(f, stream=out, color=color)
iterator = enumerate(format_string)
for i, c in iterator:
@@ -2802,7 +2799,7 @@ class Spec(object):
write(fmt % str(self.variants), '+')
elif named_str == 'ARCHITECTURE':
if self.architecture and str(self.architecture):
- write(fmt % str(self.architecture), ' arch=')
+ write(fmt % str(self.architecture), '=')
elif named_str == 'SHA1':
if self.dependencies:
out.write(fmt % str(self.dag_hash(7)))