From f2de4caa72f30affea0c216a2be2ee41fa03d6bc Mon Sep 17 00:00:00 2001 From: KG Date: Mon, 6 Jan 2025 17:53:02 -0500 Subject: [PATCH] Don't warn on assembly program version --- tivars/types/tokenized.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tivars/types/tokenized.py b/tivars/types/tokenized.py index da847e8..e1c04b2 100644 --- a/tivars/types/tokenized.py +++ b/tivars/types/tokenized.py @@ -383,13 +383,13 @@ def unprotect(self): def load_bytes(self, data: bytes | BytesIO): super(TokenizedEntry, self).load_bytes(data) - try: - if self.version != (version := self.get_version()): - warn(f"The version is incorrect (expected 0x{version:02x}, got 0x{self.version:02x}).", - BytesWarning) + if self.is_tokenized: + try: + if self.version != (version := self.get_version()): + warn(f"The version is incorrect (expected 0x{version:02x}, got 0x{self.version:02x}).", + BytesWarning) - except ValueError as e: - if self.is_tokenized: + except ValueError as e: warn(f"The file contains an invalid token {' '.join(str(e).split()[2:])}.", BytesWarning)