mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-15 12:15:22 +08:00
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.
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user