summaryrefslogtreecommitdiff
path: root/python/src/sa/int_list.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2013-06-02 14:55:53 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2013-06-02 14:55:53 -0400
commit5871cbe8d3100f17dbe9642bbd7b417b60ca38f0 (patch)
tree9b125a6df035e04da78fb6c94fffc20d4fa3747e /python/src/sa/int_list.pxi
parent6056d82900785c4dcdc7b7d871e27d768042b250 (diff)
Possible fix for #13
- use IntList .len instead of len() which can return long - a bit of code cleanup - upgrade to Cython 0.19
Diffstat (limited to 'python/src/sa/int_list.pxi')
-rw-r--r--python/src/sa/int_list.pxi4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/src/sa/int_list.pxi b/python/src/sa/int_list.pxi
index 79d67ad9..46d434e7 100644
--- a/python/src/sa/int_list.pxi
+++ b/python/src/sa/int_list.pxi
@@ -29,12 +29,12 @@ cdef class IntList:
ret += str(self.len)
return ret
- def index(self, val):
+ def index(self, int val):
cdef unsigned i
for i in range(self.len):
if self.arr[i] == val:
return i
- return IndexError
+ raise ValueError('%s not in IntList' % val)
def partition(self,start,end):
pivot = self.arr[end]