Fix pickling ddrescue State()
This commit is contained in:
parent
bddf47816f
commit
24e4f7ddcc
1 changed files with 6 additions and 0 deletions
|
|
@ -171,6 +171,12 @@ class BlockPair():
|
|||
# Set initial status
|
||||
self.set_initial_status()
|
||||
|
||||
def __getstate__(self):
|
||||
"""Override to allow pickling ddrescue.State() objects."""
|
||||
bp_state = self.__dict__.copy()
|
||||
del bp_state['view_proc']
|
||||
return bp_state
|
||||
|
||||
def get_error_size(self) -> int:
|
||||
"""Get error size in bytes, returns int."""
|
||||
return self.size - self.get_rescued_size()
|
||||
|
|
|
|||
Loading…
Reference in a new issue