Author: Lukas Diekmann <[email protected]>
Branch: list-strategies
Changeset: r47471:e7955881eadb
Date: 2011-03-16 11:46 +0100
http://bitbucket.org/pypy/pypy/changeset/e7955881eadb/
Log: Fixed untested path in RangeListStrategy.setslice
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -363,7 +363,7 @@
def setslice(self, w_list, start, step, slicelength, sequence_w):
self.switch_to_integer_strategy(w_list)
- w_list.setslice(start, step, slicelength)
+ w_list.setslice(start, step, slicelength, sequence_w)
def insert(self, w_list, index, w_item):
self.switch_to_integer_strategy(w_list)
diff --git a/pypy/objspace/std/test/test_liststrategies.py
b/pypy/objspace/std/test/test_liststrategies.py
--- a/pypy/objspace/std/test/test_liststrategies.py
+++ b/pypy/objspace/std/test/test_liststrategies.py
@@ -191,3 +191,9 @@
l.pop(-1)
assert isinstance(l.strategy, EmptyListStrategy)
+
+ def test_range_setslice(self):
+ l = make_range_list(self.space, 1, 3, 5)
+ assert isinstance(l.strategy, RangeListStrategy)
+ l.setslice(0, 1, 3, [self.space.wrap(1), self.space.wrap(2),
self.space.wrap(3)])
+ assert isinstance(l.strategy, IntegerListStrategy)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit