Skip to content

Commit

Permalink
Correctly restore data for container
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed May 20, 2021
1 parent 1b610fd commit 60da0c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tomlkit/container.py
Expand Up @@ -654,13 +654,18 @@ def __reduce_ex__(self, protocol):
return (
self.__class__,
self._getstate(protocol),
(self._map, self._body, self._parsed),
(self._map, self._body, self._parsed, self._table_keys),
)

def __setstate__(self, state):
self._map = state[0]
self._body = state[1]
self._parsed = state[2]
self._table_keys = state[3]

for key, item in self._body:
if key is not None:
dict.__setitem__(self, key.key, item.value)

def copy(self): # type: () -> Container
return copy.copy(self)
Expand Down

0 comments on commit 60da0c0

Please sign in to comment.