mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
add comment explaining attributeerror
This commit is contained in:
parent
bfc2ade9b3
commit
0c9db26260
@ -47,6 +47,9 @@ class _EventInternalMetadata(object):
|
|||||||
|
|
||||||
|
|
||||||
def _event_dict_property(key):
|
def _event_dict_property(key):
|
||||||
|
# We want to be able to use hasattr with the event dict properties.
|
||||||
|
# However, (on python3) hasattr expects AttributeError to be raised. Hence,
|
||||||
|
# we need to transform the KeyError into an AttributeError
|
||||||
def getter(self):
|
def getter(self):
|
||||||
try:
|
try:
|
||||||
return self._event_dict[key]
|
return self._event_dict[key]
|
||||||
|
Loading…
Reference in New Issue
Block a user