Python 3 bug issue with alert

This commit is contained in:
Nicolargo 2014-08-03 19:06:25 +02:00
parent 9371ec5205
commit dc55711540

View File

@ -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