Merge pull request #1460 from renatahodovan/intervalset-range-fix
Fix AttributeError when trying to write an immutable variable in Python.
This commit is contained in:
commit
82372aae2c
|
@ -164,7 +164,7 @@ class IntervalSet(object):
|
||||||
# split existing range
|
# split existing range
|
||||||
elif v<i.stop-1:
|
elif v<i.stop-1:
|
||||||
x = Interval(i.start, v)
|
x = Interval(i.start, v)
|
||||||
i.start = v + 1
|
self.intervals[k] = range(v + 1, i.stop)
|
||||||
self.intervals.insert(k, x)
|
self.intervals.insert(k, x)
|
||||||
return
|
return
|
||||||
k += 1
|
k += 1
|
||||||
|
|
|
@ -144,7 +144,7 @@ class IntervalSet(object):
|
||||||
# split existing range
|
# split existing range
|
||||||
elif v<i.stop-1:
|
elif v<i.stop-1:
|
||||||
x = range(i.start, v)
|
x = range(i.start, v)
|
||||||
i.start = v + 1
|
self.intervals[k] = range(v + 1, i.stop)
|
||||||
self.intervals.insert(k, x)
|
self.intervals.insert(k, x)
|
||||||
return
|
return
|
||||||
k += 1
|
k += 1
|
||||||
|
|
Loading…
Reference in New Issue