proper fix

This commit is contained in:
Miroslav Stampar 2010-12-10 13:26:31 +00:00
parent 9957881040
commit fe186cde55

View File

@ -460,14 +460,15 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
conf.verbose = popValue() conf.verbose = popValue()
if expected == EXPECTED.BOOL: if expected == EXPECTED.BOOL:
if isinstance(value, basestring): if value:
value = value.lower() if isinstance(value, basestring):
if value in ("true", "false"): value = value.lower()
if value in ("true", "false"):
value = bool(value)
else:
value = value != "0"
elif isinstance(value, int):
value = bool(value) value = bool(value)
else:
value = value and value != "0"
elif isinstance(value, int):
value = bool(value)
return value return value