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:
Scott Sanderson
2014-09-02 20:42:49 -04:00
parent 5d5dbb5c3a
commit 1b2d79988f
+1 -1
View File
@@ -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__