From 9ee7dc27e85f1d6e948210818a4b68082bf5792d Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Wed, 5 Jan 2011 19:21:17 +0000 Subject: [PATCH] Do slice stepping correctly --- src/calibre/library/caches.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index ada1ee0a77..2596b494bf 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -144,7 +144,9 @@ class CacheRow(list): if self._must_do: is_comp = False if isinstance(col, slice): - for c in range(col.start, col.stop): + start = 0 if col.start is None else col.start + step = 1 if col.stop is None else col.stop + for c in range(start, col.stop, step): if c in self._composites: is_comp = True break