Skip to content

Commit

Permalink
Fix (un)pickling
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau committed Aug 4, 2023
1 parent 880753d commit 26345d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/localstack_persist/visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _load_json(self, state_container: StateContainer, file_path: str):
)

unpickler = jsonpickle.Unpickler(keys=True, safe=True, on_missing="warn")
deserialised = unpickler.restore(envelope[DATA_KEY], reset=False)
deserialised = unpickler.restore(envelope[DATA_KEY])

state_container.update(deserialised)
state_container.__dict__.update(deserialised.__dict__)
Expand All @@ -90,7 +90,7 @@ def visit(self, state_container: StateContainer):

def _save_json(self, state_container: dict, file_path: str):
pickler = jsonpickle.Pickler(keys=True, warn=True)
flattened = pickler.flatten(state_container, reset=False)
flattened = pickler.flatten(state_container)

envelope = {SER_VERSION_KEY: SER_VERSION, DATA_KEY: flattened}

Expand Down

0 comments on commit 26345d3

Please sign in to comment.