Merge pull request #1493 from xjrc/bugfix/nonbool-variants

Bug Fix : Allow Packages to Have Variants w/ Non-Bool, Non-String Defaults
This commit is contained in:
becker33 2016-08-11 11:33:54 -07:00 committed by GitHub
commit ec7f58bf96

View file

@ -332,11 +332,10 @@ def copy(self):
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):