Skip to content

Commit

Permalink
Merge pull request #909 from onekey-sec/dissect-cstruct-40-compatibility
Browse files Browse the repository at this point in the history
fix(extract): ensure that reports are pickleable
  • Loading branch information
vlaci authored Aug 7, 2024
2 parents fd5847d + 3653e5c commit 5e775ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions unblob/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
class Report:
"""A common base class for different reports."""

def __attrs_post_init__(self):
for field in attr.fields(type(self)):
value = getattr(self, field.name)
if isinstance(value, int):
object.__setattr__(self, field.name, int(value))

def asdict(self) -> dict:
return attr.asdict(self)

Expand Down

0 comments on commit 5e775ac

Please sign in to comment.