From dc557115403a1248496e9ccfc656100e0b2de1aa Mon Sep 17 00:00:00 2001 From: Nicolargo Date: Sun, 3 Aug 2014 19:06:25 +0200 Subject: [PATCH] Python 3 bug issue with alert --- glances/plugins/glances_alert.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/glances/plugins/glances_alert.py b/glances/plugins/glances_alert.py index 0a920d3d..25eff22a 100644 --- a/glances/plugins/glances_alert.py +++ b/glances/plugins/glances_alert.py @@ -125,8 +125,7 @@ class Plugin(GlancesPlugin): """ Compare a with b using the tolerance (if numerical) """ - numericalType = [types.IntType, types.FloatType, types.LongType] - if type(a) in numericalType and type(b) in numericalType: + if str(int(a)).isdigit() and str(int(b)).isdigit(): return abs(a-b) <= max(abs(a), abs(b)) * tolerance else: return a == b