From fe186cde55e9a1b3eb7910791ea711cae2b4f9ff Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 10 Dec 2010 13:26:31 +0000 Subject: [PATCH] proper fix --- lib/request/inject.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/request/inject.py b/lib/request/inject.py index 0067f6853..54c09400f 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -460,14 +460,15 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse conf.verbose = popValue() if expected == EXPECTED.BOOL: - if isinstance(value, basestring): - value = value.lower() - if value in ("true", "false"): + if value: + if isinstance(value, basestring): + value = value.lower() + if value in ("true", "false"): + value = bool(value) + else: + value = value != "0" + elif isinstance(value, int): value = bool(value) - else: - value = value and value != "0" - elif isinstance(value, int): - value = bool(value) return value