提交 dc557115 编写于 作者: N Nicolargo

Python 3 bug issue with alert

上级 9371ec52
...@@ -125,8 +125,7 @@ class Plugin(GlancesPlugin): ...@@ -125,8 +125,7 @@ class Plugin(GlancesPlugin):
""" """
Compare a with b using the tolerance (if numerical) Compare a with b using the tolerance (if numerical)
""" """
numericalType = [types.IntType, types.FloatType, types.LongType] if str(int(a)).isdigit() and str(int(b)).isdigit():
if type(a) in numericalType and type(b) in numericalType:
return abs(a-b) <= max(abs(a), abs(b)) * tolerance return abs(a-b) <= max(abs(a), abs(b)) * tolerance
else: else:
return a == b return a == b
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册