Skip to content

Commit

Permalink
Don't warn on incorrect subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Jan 6, 2025
1 parent be8d158 commit 9480116
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tivars/var.py
Original file line number Diff line number Diff line change
Expand Up @@ -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). "
Expand Down

0 comments on commit 9480116

Please sign in to comment.