[pypy-commit] pypy py3.5: translation fix

arigo pypy.commits at gmail.com
Wed Feb 1 04:52:52 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89874:5699b5075b86
Date: 2017-02-01 10:52 +0100
http://bitbucket.org/pypy/pypy/changeset/5699b5075b86/

Log:	translation fix

diff --git a/pypy/objspace/std/tupleobject.py b/pypy/objspace/std/tupleobject.py
--- a/pypy/objspace/std/tupleobject.py
+++ b/pypy/objspace/std/tupleobject.py
@@ -196,7 +196,10 @@
         items = self.tolist()
         length = len(items)
         start, stop, step, slicelength = w_index.indices4(space, length)
-        if step == 1:
+        if slicelength == 0:
+            subitems = []
+        elif step == 1:
+            assert 0 <= start <= stop
             subitems = items[start:stop]
         else:
             subitems = self._getslice_advanced(items, start, step, slicelength)


More information about the pypy-commit mailing list