Skip to content

Commit

Permalink
Fine
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Oct 29, 2017
1 parent 36f8927 commit 4149dd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions jsonschema/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ def dependencies(validator, dependencies, instance, schema):
if property not in instance:
continue

if dependency == True:
if dependency is True:
dependency = {}
elif dependency == False:
elif dependency is False:
dependency = {"not": {}}

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

def allOf_draft6(validator, allOf, instance, schema):
for index, subschema in enumerate(allOf):
if subschema == True: # FIXME: Messages
if subschema is True: # FIXME: Messages
subschema = {}
elif subschema == False:
elif subschema is False:
subschema = {"not": {}}
for error in validator.descend(instance, subschema, schema_path=index):
yield error
Expand Down Expand Up @@ -482,9 +482,9 @@ def anyOf_draft4(validator, anyOf, instance, schema):
def anyOf_draft6(validator, anyOf, instance, schema):
all_errors = []
for index, subschema in enumerate(anyOf):
if subschema == True: # FIXME: Messages
if subschema is True: # FIXME: Messages
subschema = {}
elif subschema == False:
elif subschema is False:
subschema = {"not": {}}
errs = list(validator.descend(instance, subschema, schema_path=index))
if not errs:
Expand Down
8 changes: 4 additions & 4 deletions jsonschema/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def __init__(
self._types.update(types)

if resolver is None:
if schema == True:
if schema is True:
resolver = RefResolver.from_schema({})
elif schema == False:
elif schema is False:
resolver = RefResolver.from_schema({"not": {}})
else:
resolver = RefResolver.from_schema(schema)
Expand All @@ -96,9 +96,9 @@ def iter_errors(self, instance, _schema=None):
if _schema is None:
_schema = self.schema

if _schema == True:
if _schema is True:
_schema = {}
elif _schema == False:
elif _schema is False:
_schema = {"not": {}}

scope = _schema.get(u"$id")
Expand Down

0 comments on commit 4149dd8

Please sign in to comment.