Added exception when base index out of range in a normal (non-indexed) segment

* matches what happens in indexed segments
This commit is contained in:
Rob McMullen 2016-04-18 10:34:40 -07:00
parent 2edfc1786c
commit e9640269f9

View File

@ -258,6 +258,8 @@ class DefaultSegment(object):
index = r.get_reverse_index(base_index)
else:
index = base_index - r.get_raw_index(0)
if not self.is_valid_index(index):
raise IndexError("index %d not in this segment" % base_index)
return index
def tostring(self):