Skip to content

Commit

Permalink
Add extra coercion warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Apr 22, 2024
1 parent 09b41ea commit ccf5944
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tivars/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,5 +790,9 @@ def coerce(self):
warn(f"Type ID 0x{self.type_id:02x} is not recognized; header will not be coerced to a subclass.",
BytesWarning)

else:
warn("Type ID is 0xFF, no coercion will occur.",
UserWarning)


__all__ = ["DeviceType", "BCDDate", "BCDRevision", "TIFlashBlock", "TIFlashHeader"]
4 changes: 4 additions & 0 deletions tivars/var.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,10 @@ def coerce(self):
warn(f"Type ID 0x{self.type_id:02x} is not recognized; entry will not be coerced to a subclass.",
BytesWarning)

else:
warn("Type ID is 0xFF, no coercion will occur.",
UserWarning)


class TIVar:
"""
Expand Down

0 comments on commit ccf5944

Please sign in to comment.