ignore KeyErrors when removing flags

This commit is contained in:
Luna 2020-02-26 14:01:22 -03:00
parent b015cce7a9
commit f69d0aa724
1 changed files with 4 additions and 1 deletions

View File

@ -140,7 +140,10 @@ class DispatcherWithFlags(
def remove_flags(self, key: K, identifier: V): def remove_flags(self, key: K, identifier: V):
"""Set flags for the given identifier.""" """Set flags for the given identifier."""
try:
self.flags[key].pop(identifier) self.flags[key].pop(identifier)
except KeyError:
pass
def get_flags(self, key: K, identifier: V): def get_flags(self, key: K, identifier: V):
"""Get a single field from the flags store.""" """Get a single field from the flags store."""