Skip to content

Commit d01c726

Browse files
committed
fix(extract): ensure that reports are pickleable
Unfortunately `dissect.cstruct` 4.0 types are not pickleable
1 parent ce2f1ee commit d01c726

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

unblob/report.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
class Report:
1414
"""A common base class for different reports."""
1515

16+
def __attrs_post_init__(self):
17+
for field in attr.fields(type(self)):
18+
value = getattr(self, field.name)
19+
if isinstance(value, int):
20+
object.__setattr__(self, field.name, int(value))
21+
1622
def asdict(self) -> dict:
1723
return attr.asdict(self)
1824

0 commit comments

Comments
 (0)