summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jsonschema/validators.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/jsonschema/validators.py b/jsonschema/validators.py
index c8148fe..16168a3 100644
--- a/jsonschema/validators.py
+++ b/jsonschema/validators.py
@@ -140,13 +140,10 @@ def create(meta_schema, validators=(), version=None, default_types=None):
pytypes = self._types[type]
# bool inherits from int, so ensure bools aren't reported as ints
- if isinstance(instance, bool):
- pytypes = _utils.flatten(pytypes)
- is_number = any(
- issubclass(pytype, numbers.Number) for pytype in pytypes
- )
- if is_number and bool not in pytypes:
- return False
+ if (isinstance(instance, bool) and
+ issubclass(int, pytypes) and
+ bool not in _utils.flatten(pytypes)):
+ return False
return isinstance(instance, pytypes)
def is_valid(self, instance, _schema=None):