From 95872d49aef9a44b570f7370b92c5c9710b2af80 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Tue, 17 Dec 2024 11:52:14 +0100 Subject: [PATCH] lints --- jupyter_events/validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter_events/validators.py b/jupyter_events/validators.py index 72881ef..bd7a161 100644 --- a/jupyter_events/validators.py +++ b/jupyter_events/validators.py @@ -61,7 +61,7 @@ def validate_schema(schema: dict[str, Any]) -> None: try: # If the `version` attribute is an integer, coerce to string. # TODO: remove this in a future version. - if "version" in schema and type(schema["version"]) == int: + if "version" in schema and isinstance(schema["version"], int): schema["version"] = str(schema["version"]) msg = ( "The `version` property of an event schema must be a string. " @@ -69,7 +69,7 @@ def validate_schema(schema: dict[str, Any]) -> None: "library, it will fail to validate. Please update schema: " f"{schema['$id']}" ) - warnings.warn(JupyterEventsVersionWarning(msg)) + warnings.warn(JupyterEventsVersionWarning(msg), stacklevel=2) # Validate the schema against Jupyter Events metaschema. JUPYTER_EVENTS_SCHEMA_VALIDATOR.validate(schema) except ValidationError as err: