Skip to content

Commit 4149dd8

Browse files
committed
Fine
1 parent 36f8927 commit 4149dd8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

jsonschema/_validators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ def dependencies(validator, dependencies, instance, schema):
275275
if property not in instance:
276276
continue
277277

278-
if dependency == True:
278+
if dependency is True:
279279
dependency = {}
280-
elif dependency == False:
280+
elif dependency is False:
281281
dependency = {"not": {}}
282282

283283
if validator.is_type(dependency, "object"):
@@ -433,9 +433,9 @@ def allOf_draft4(validator, allOf, instance, schema):
433433

434434
def allOf_draft6(validator, allOf, instance, schema):
435435
for index, subschema in enumerate(allOf):
436-
if subschema == True: # FIXME: Messages
436+
if subschema is True: # FIXME: Messages
437437
subschema = {}
438-
elif subschema == False:
438+
elif subschema is False:
439439
subschema = {"not": {}}
440440
for error in validator.descend(instance, subschema, schema_path=index):
441441
yield error
@@ -482,9 +482,9 @@ def anyOf_draft4(validator, anyOf, instance, schema):
482482
def anyOf_draft6(validator, anyOf, instance, schema):
483483
all_errors = []
484484
for index, subschema in enumerate(anyOf):
485-
if subschema == True: # FIXME: Messages
485+
if subschema is True: # FIXME: Messages
486486
subschema = {}
487-
elif subschema == False:
487+
elif subschema is False:
488488
subschema = {"not": {}}
489489
errs = list(validator.descend(instance, subschema, schema_path=index))
490490
if not errs:

jsonschema/validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ def __init__(
7676
self._types.update(types)
7777

7878
if resolver is None:
79-
if schema == True:
79+
if schema is True:
8080
resolver = RefResolver.from_schema({})
81-
elif schema == False:
81+
elif schema is False:
8282
resolver = RefResolver.from_schema({"not": {}})
8383
else:
8484
resolver = RefResolver.from_schema(schema)
@@ -96,9 +96,9 @@ def iter_errors(self, instance, _schema=None):
9696
if _schema is None:
9797
_schema = self.schema
9898

99-
if _schema == True:
99+
if _schema is True:
100100
_schema = {}
101-
elif _schema == False:
101+
elif _schema is False:
102102
_schema = {"not": {}}
103103

104104
scope = _schema.get(u"$id")

0 commit comments

Comments
 (0)