From 1b2d79988f72dc7144bd8263208a12c776d65605 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Tue, 2 Sep 2014 20:42:49 -0400 Subject: [PATCH] BUG: Fix exception when comparing Event to object with no __dict__. In particular don't throw an exception on comparison to `None`. --- zipline/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/protocol.py b/zipline/protocol.py index 9aa7fa5c..d7bc4997 100644 --- a/zipline/protocol.py +++ b/zipline/protocol.py @@ -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__