From 9480116169da0b5fd83b6e77e267e452e5996d48 Mon Sep 17 00:00:00 2001 From: KG Date: Mon, 6 Jan 2025 17:52:41 -0500 Subject: [PATCH] Don't warn on incorrect subclass --- tivars/var.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tivars/var.py b/tivars/var.py index 17b95e5..4702477 100644 --- a/tivars/var.py +++ b/tivars/var.py @@ -732,8 +732,9 @@ def load_bytes(self, data: bytes | BytesIO): if self._type_id is not None and self.type_id != self._type_id: if subclass := TIEntry.get_type(self.type_id): - warn(f"The entry type is incorrect (expected {type(self)}, got {subclass}).", - BytesWarning) + if not issubclass(subclass, self.__class__): + warn(f"The entry type is incorrect (expected {type(self)}, got {subclass}).", + BytesWarning) else: warn(f"The entry type is incorrect (expected {type(self)}, got an unknown type). "