mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-20 12:20:29 +08:00
BUG: Fix exception when comparing Event to object with no __dict__.
In particular don't throw an exception on comparison to `None`.
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@ class Event(object):
|
||||
return self.__dict__.keys()
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__dict__ == other.__dict__
|
||||
return hasattr(other, '__dict__') and self.__dict__ == other.__dict__
|
||||
|
||||
def __contains__(self, name):
|
||||
return name in self.__dict__
|
||||
|
||||
Reference in New Issue
Block a user