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:
Richard Frank
2014-03-05 14:40:05 -05:00
parent 63f1c791da
commit e7ec629510
+3 -3
View File
@@ -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')