From 08ff0b93d137b3ddefd8333dc40a3f6847b68f5d Mon Sep 17 00:00:00 2001 From: Afshin Taylor Darian Date: Tue, 29 Oct 2024 16:41:34 +0000 Subject: [PATCH] Prevent unintended `KeyError` when emitting an unregistered event schema (#101) --- jupyter_events/logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jupyter_events/logger.py b/jupyter_events/logger.py index 63838e0..8cc1fba 100644 --- a/jupyter_events/logger.py +++ b/jupyter_events/logger.py @@ -339,8 +339,8 @@ def emit( # If no handlers are routing these events, there's no need to proceed. if ( not self.handlers - and not self._modified_listeners[schema_id] - and not self._unmodified_listeners[schema_id] + and not self._modified_listeners.get(schema_id) + and not self._unmodified_listeners.get(schema_id) ): return None