summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoseph Ciurej <ciurej1@llnl.gov>2016-08-10 11:54:33 -0700
committerJoseph Ciurej <ciurej1@llnl.gov>2016-08-10 11:54:33 -0700
commitaa860bf4dfe6ebe96f4de5bd2c91e4223eca4d7b (patch)
tree798818e76cdb20f95fa082fb3419f9cac004fb0a /lib
parentd380d1642722c44837cb32712972f19b70476ecb (diff)
downloadspack-aa860bf4dfe6ebe96f4de5bd2c91e4223eca4d7b.tar.gz
spack-aa860bf4dfe6ebe96f4de5bd2c91e4223eca4d7b.tar.bz2
spack-aa860bf4dfe6ebe96f4de5bd2c91e4223eca4d7b.tar.xz
spack-aa860bf4dfe6ebe96f4de5bd2c91e4223eca4d7b.zip
Fixed a bug that was making packages with non-bool default variants to crash.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/spec.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index a37b39be67..714ee82c2a 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -328,11 +328,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):