Skip to content

Commit

Permalink
add comment explaining attributeerror
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAFile committed Apr 30, 2018
1 parent bfc2ade commit 0c9db26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def get_send_on_behalf_of(self):


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]
Expand Down

0 comments on commit 0c9db26

Please sign in to comment.