Skip to content

Commit

Permalink
Fix failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Jun 19, 2018
1 parent 50231d9 commit 0ebdc48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions peewee.py
Expand Up @@ -1626,9 +1626,9 @@ def __getitem__(self, value):
index = value.stop
else:
index = value
if index is not None and index >= 0:
index += 1
self._cursor_wrapper.fill_cache(index if index > 0 else 0)
if index is not None:
index = index + 1 if index >= 0 else 0
self._cursor_wrapper.fill_cache(index)
return self._cursor_wrapper.row_cache[value]

def __len__(self):
Expand Down

0 comments on commit 0ebdc48

Please sign in to comment.