mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 12:30:07 +00:00
storage: fix convert_version_18
This commit is contained in:
parent
9ecb504739
commit
b134f04fef
1 changed files with 6 additions and 0 deletions
|
@ -105,6 +105,12 @@ class JsonDB(PrintError):
|
||||||
self.data[key] = copy.deepcopy(value)
|
self.data[key] = copy.deepcopy(value)
|
||||||
return True
|
return True
|
||||||
elif key in self.data:
|
elif key in self.data:
|
||||||
|
# clear current contents in case of references
|
||||||
|
cur_val = self.data[key]
|
||||||
|
clear_method = getattr(cur_val, "clear", None)
|
||||||
|
if callable(clear_method):
|
||||||
|
clear_method()
|
||||||
|
# pop from dict to delete key
|
||||||
self.data.pop(key)
|
self.data.pop(key)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Add table
Reference in a new issue