Author: Lukas Diekmann <lukas.diekm...@uni-duesseldorf.de> Branch: list-strategies Changeset: r47476:4c0e74dd0f30 Date: 2011-03-16 14:53 +0100 http://bitbucket.org/pypy/pypy/changeset/4c0e74dd0f30/
Log: This will make rtyper happier...hopefully 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 @@ -412,10 +412,12 @@ return len(self.cast_from_void_star(w_list.storage)) def getitem(self, w_list, index): + l = self.cast_from_void_star(w_list.storage) try: - return self.wrap(self.cast_from_void_star(w_list.storage)[index]) + r = l[index] except IndexError: # make RPython raise the exception raise + return self.wrap(r) def getitems(self, w_list): return [self.wrap(item) for item in self.cast_from_void_star(w_list.storage)] _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit