diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/spec.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 0d72d454c6..316b7d6a8c 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -332,11 +332,10 @@ class VariantSpec(object): return VariantSpec(self.name, self.value) def __str__(self): - if self.value in [True, False]: - out = '+' if self.value else '~' - return out + self.name + if type(self.value) == bool: + return '{0}{1}'.format('+' if self.value else '~', self.name) else: - return ' ' + self.name + "=" + self.value + return ' {0}={1}'.format(self.name, self.value) class VariantMap(HashableMap): |