summaryrefslogtreecommitdiff
path: root/mdbp
diff options
context:
space:
mode:
Diffstat (limited to 'mdbp')
-rw-r--r--mdbp/common.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mdbp/common.py b/mdbp/common.py
index c2be081..c03ab37 100644
--- a/mdbp/common.py
+++ b/mdbp/common.py
@@ -19,8 +19,9 @@ import requests
try:
import jsonschema
+ HAVE_JSONSCHEMA = True
except ImportError:
- jsonschema = None
+ HAVE_JSONSCHEMA = False
if typing.TYPE_CHECKING:
# pylint: disable=E1101,W0212
@@ -38,7 +39,7 @@ JsonObject = typing.Dict[str, typing.Any]
def buildjson_validate(buildobj: JsonObject) -> None:
"""Validate the given build json object against the schema."""
- if jsonschema:
+ if HAVE_JSONSCHEMA:
jsonschema.validate(
buildobj,
json_load(