Skip to content

Commit

Permalink
Fix KeyError when properties are invalidated multiple times
Browse files Browse the repository at this point in the history
Fixes #272
  • Loading branch information
coldfix committed Oct 3, 2023
1 parent 7fb9cbb commit 461fd3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion udiskie/udisks2.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,10 @@ def _properties_changed(self,
# update device state:
old_state = deepcopy(self._objects[object_path])
for property_name in invalidated_properties:
del self._objects[object_path][interface_name][property_name]
try:
del self._objects[object_path][interface_name][property_name]
except KeyError:
pass
for key, value in changed_properties.items():
self._objects[object_path][interface_name][key] = value
new_state = self._objects[object_path]
Expand Down

0 comments on commit 461fd3a

Please sign in to comment.