1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 10:18:12 +00:00

PropDict: fail early if internal_dict is not a dict

This commit is contained in:
Thomas Waldmann 2020-11-10 13:35:07 +01:00
parent 122dfce405
commit 0e1cf2056b

View file

@ -43,11 +43,15 @@ class PropDict:
if data_dict is None:
data = kw
elif not isinstance(data_dict, dict):
raise TypeError("data_dict must be dict")
raise TypeError("data_dict must be a dict")
else:
data = data_dict
if internal_dict is None:
internal_dict = {}
elif not isinstance(internal_dict, dict):
raise TypeError("internal_dict must be a dict")
self._dict = {}
self.update_internal(internal_dict or {})
self.update_internal(internal_dict)
self.update(data)
def update(self, d):