diff options
author | Helmut Grohne <helmut@subdivi.de> | 2022-06-23 20:12:10 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2022-06-23 20:12:10 +0200 |
commit | d99d7eb5bcfbcac71b14fa68248eb87b7eb5330f (patch) | |
tree | 09dd27fb367b42f43f64818ac4d641d9a092a3af /mdbp/common.py | |
parent | 465b81f546b465445e55428a15f0d978d9bbb67f (diff) | |
download | mdbp-d99d7eb5bcfbcac71b14fa68248eb87b7eb5330f.tar.gz |
common: rephrase optional import to make mypy --strict happy
Diffstat (limited to 'mdbp/common.py')
-rw-r--r-- | mdbp/common.py | 5 |
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( |