From d3a4f255f0f74011ab57e94b05bbf28d16bb3a20 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Tue, 13 Sep 2022 14:09:54 +0200 Subject: [PATCH] Common: Use isinstance in PydanticEventSerializer --- monkey/common/event_serializers/pydantic_event_serializer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/common/event_serializers/pydantic_event_serializer.py b/monkey/common/event_serializers/pydantic_event_serializer.py index 692a3cea8..263e3463b 100644 --- a/monkey/common/event_serializers/pydantic_event_serializer.py +++ b/monkey/common/event_serializers/pydantic_event_serializer.py @@ -15,7 +15,7 @@ class PydanticEventSerializer(IEventSerializer, Generic[T]): self._event_class = event_class def serialize(self, event: T) -> JSONSerializable: - if not issubclass(event.__class__, self._event_class): + if not isinstance(event, self._event_class): raise TypeError(f"Event object must be of type: {self._event_class.__name__}") return event.dict(simplify=True)