projects
/
hooke.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Adjust NoteIndexList._index in .index() if it falls off the end of the list.
[hooke.git]
/
hooke
/
playlist.py
diff --git
a/hooke/playlist.py
b/hooke/playlist.py
index f323ca2b099043875c384e9fcd4831d4288cd495..52d8df1352e6077ae77651512a8eab1305ba3718 100644
(file)
--- a/
hooke/playlist.py
+++ b/
hooke/playlist.py
@@
-88,6
+88,8
@@
class NoteIndexList (list):
is `None`.
"""
if value == None:
+ if self._index >= len(self): # perhaps items have been popped
+ self._index = len(self) - 1
return self._index
return super(NoteIndexList, self).index(value, *args, **kwargs)