From 413fe950176c02eabddbfb46af1c5ab8c328bd48 Mon Sep 17 00:00:00 2001 From: ichuang Date: Tue, 12 Jun 2012 13:43:14 -0400 Subject: [PATCH] util: tol.endswith --- common/lib/capa/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/capa/util.py b/common/lib/capa/util.py index f1cc8f859e..58e701cbc3 100644 --- a/common/lib/capa/util.py +++ b/common/lib/capa/util.py @@ -13,7 +13,7 @@ def compare_with_tolerance(v1, v2, tol): - tol : tolerance (string or number) ''' - relative = "%" in tol + relative = tol.endswith('%') if relative: tolerance_rel = evaluator(dict(),dict(),tol[:-1]) * 0.01 tolerance = tolerance_rel * max(abs(v1), abs(v2))