From e7ec62951000825589d717e9e7005029250e5941 Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Wed, 5 Mar 2014 11:49:08 -0500 Subject: [PATCH] MAINT: Cleaned up sid checks and exception types Removed unnecessary parens Keeping NameError reserved for when locals or globals are not found. Exception is what we use for the other sid checks, so now they are consistent. --- zipline/finance/performance/position.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zipline/finance/performance/position.py b/zipline/finance/performance/position.py index 3ad0ff31..01f72d29 100644 --- a/zipline/finance/performance/position.py +++ b/zipline/finance/performance/position.py @@ -88,8 +88,8 @@ class Position(object): # Returns the unused cash. def handle_split(self, split): - if (self.sid != split.sid): - raise NameError("updating split with the wrong sid!") + if self.sid != split.sid: + raise Exception("updating split with the wrong sid!") ratio = split.ratio @@ -132,7 +132,7 @@ class Position(object): return return_cash def update(self, txn): - if(self.sid != txn.sid): + if self.sid != txn.sid: raise Exception('updating position with txn for a ' 'different sid')