Author: Lukas Diekmann <lukas.diekm...@uni-duesseldorf.de>
Branch: list-strategies
Changeset: r47500:4c910a687b80
Date: 2011-04-21 11:12 +0200
http://bitbucket.org/pypy/pypy/changeset/4c910a687b80/

Log:    Fixed setslice on EmptyList to work with RPython

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
@@ -185,6 +185,9 @@
     def getitems_copy(self, w_list):
         raise NotImplementedError
 
+    def getstorage_copy(self, w_list):
+        return self.cast_to_void_star(self.getitems_copy(w_list))
+
     def append(self, w_list, w_item):
         raise NotImplementedError
 
@@ -272,9 +275,8 @@
         raise IndexError
 
     def setslice(self, w_list, start, step, slicelength, w_other):
-        items = w_other.getitems_copy()
         strategy = w_other.strategy
-        storage = strategy.cast_to_void_star(items)
+        storage = strategy.getstorage_copy(w_other)
         w_list.strategy = strategy
         w_list.lstorage = storage
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to