Skip to content

Commit c348f9d

Browse files
eladkalblink1073
andauthored
Fix deprecation warning when importing from jsonschema (#368)
* Fix deprecation warning when importing from jsonschema * lint --------- Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
1 parent 8cb2789 commit c348f9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nbformat/json_compat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import jsonschema
1212
from fastjsonschema import JsonSchemaException as _JsonSchemaException
1313
from jsonschema import Draft4Validator as _JsonSchemaValidator
14-
from jsonschema import ErrorTree, ValidationError
14+
from jsonschema.exceptions import ErrorTree, ValidationError
1515

1616

1717
class JsonSchemaValidator:
@@ -55,7 +55,7 @@ def __init__(self, schema):
5555
def validate(self, data):
5656
"""Validate incoming data."""
5757
try:
58-
self._validator(data)
58+
self._validator(data) # type:ignore[operator]
5959
except _JsonSchemaException as error:
6060
raise ValidationError(str(error), schema_path=error.path) from error
6161

@@ -67,7 +67,7 @@ def iter_errors(self, data, schema=None):
6767
errors = []
6868
validate_func = self._validator
6969
try:
70-
validate_func(data)
70+
validate_func(data) # type:ignore[operator]
7171
except _JsonSchemaException as error:
7272
errors = [ValidationError(str(error), schema_path=error.path)]
7373

0 commit comments

Comments
 (0)