add comment explaining attributeerror

pull/3102/head
Adrian Tschira 2018-04-30 09:49:10 +02:00
parent bfc2ade9b3
commit 0c9db26260
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ class _EventInternalMetadata(object):
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):
try:
return self._event_dict[key]