Skip to content

Commit

Permalink
listen for child classes
Browse files Browse the repository at this point in the history
  • Loading branch information
vachillo committed Oct 17, 2024
1 parent 4a67b54 commit 49aeb1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion griptape/events/event_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __exit__(self, type, value, traceback) -> None: # noqa: ANN001, A002
def publish_event(self, event: T, *, flush: bool = False) -> None:
event_types = self.event_types

if event_types is None or type(event) in event_types:
if event_types is None or any(isinstance(event, event_type) for event_type in event_types):
handled_event = event
if self.handler is not None:
handled_event = self.handler(event)
Expand Down

0 comments on commit 49aeb1e

Please sign in to comment.