diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-06-06 19:32:58 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-06-06 19:32:58 +0100 |
commit | debca0c9a15855892982894cb09d7b7c3bb8dc17 (patch) | |
tree | 50b621a7fd1f22d593705b8d28c8dedb4fda2eb1 /scripts | |
parent | 6a68dde81fcbe3c6bbd45bafdeb94c3f269bdc20 (diff) |
cli/diff-state: Handle comparision between float and none.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/jsondiff.py | 3 |
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: |