summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2014-06-06 19:32:58 +0100
committerJosé Fonseca <jfonseca@vmware.com>2014-06-06 19:32:58 +0100
commitdebca0c9a15855892982894cb09d7b7c3bb8dc17 (patch)
tree50b621a7fd1f22d593705b8d28c8dedb4fda2eb1 /scripts
parent6a68dde81fcbe3c6bbd45bafdeb94c3f269bdc20 (diff)
cli/diff-state: Handle comparision between float and none.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/jsondiff.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/jsondiff.py b/scripts/jsondiff.py
index 470aeda0..bd45fdba 100755
--- a/scripts/jsondiff.py
+++ b/scripts/jsondiff.py
@@ -173,7 +173,8 @@ class Comparer(Visitor):
return True
def visitValue(self, a, b):
- if isinstance(a, float) or isinstance(b, float):
+ if isinstance(a, float) and isinstance(b, (int, long, float)) or \
+ isinstance(b, float) and isinstance(a, (int, long, float)):
if a == 0:
return abs(b) < self.tolerance
else: