Skip to content

Commit bf25216

Browse files
committed
Merge branch 'stelligent-develop' into develop
PR #188. * stelligent-develop: Change is to == to satisfy python 3.8 SyntaxWarning
2 parents 0d5762b + 56263b8 commit bf25216

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jmespath/visitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def _is_special_integer_case(x, y):
2929
# Also need to consider that:
3030
# >>> 0 in [True, False]
3131
# True
32-
if x is 0 or x is 1:
32+
if type(x) is int and (x == 0 or x == 1):
3333
return y is True or y is False
34-
elif y is 0 or y is 1:
34+
elif type(y) is int and (y == 0 or y == 1):
3535
return x is True or x is False
3636

3737

@@ -257,7 +257,7 @@ def visit_and_expression(self, node, value):
257257

258258
def visit_not_expression(self, node, value):
259259
original_result = self.visit(node['children'][0], value)
260-
if original_result is 0:
260+
if type(original_result) is int and original_result == 0:
261261
# Special case for 0, !0 should be false, not true.
262262
# 0 is not a special cased integer in jmespath.
263263
return False

0 commit comments

Comments
 (0)