Skip to content

Commit

Permalink
fix(extract): ensure that reports are pickleable
Browse files Browse the repository at this point in the history
Unfortunately `dissect.cstruct` 4.0 types are not pickleable
  • Loading branch information
vlaci authored and kissgyorgy committed Aug 7, 2024
1 parent fd5847d commit 3653e5c
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 3653e5c

Please sign in to comment.