From ec8ac0ee233afdb9ce183a4b1483fa039ce3f99c Mon Sep 17 00:00:00 2001 From: gmabey Date: Thu, 6 Jul 2023 10:41:53 -0600 Subject: [PATCH] prevent exception with older jsonschema versions (#18) * prevent exception with older jsonschema versions * incremented version to 1.1.2 --------- Co-authored-by: Glen M --- sigmf/__init__.py | 2 +- sigmf/validate.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sigmf/__init__.py b/sigmf/__init__.py index 5857987..42e2136 100644 --- a/sigmf/__init__.py +++ b/sigmf/__init__.py @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -__version__ = '1.1.1' +__version__ = '1.1.2' from .archive import SigMFArchive from .sigmffile import SigMFFile, SigMFCollection diff --git a/sigmf/validate.py b/sigmf/validate.py index f7a13d5..a251bdd 100644 --- a/sigmf/validate.py +++ b/sigmf/validate.py @@ -65,8 +65,7 @@ def validate(metadata, ref_schema=schema.get_schema()): ------- None, will raise error if invalid. ''' - validator = jsonschema.Draft7Validator(schema=ref_schema) - validator.validate(instance=metadata) + jsonschema.validators.validate(instance=metadata, schema=ref_schema) # assure capture and annotation order # TODO: There is a way to do this with just the schema apparently.