Commit 71725822 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

this modification is really needed for Zope 2.7.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18535 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1ef34070
...@@ -631,8 +631,10 @@ class WorkflowHistoryList(Persistent): ...@@ -631,8 +631,10 @@ class WorkflowHistoryList(Persistent):
if index == -1: if index == -1:
return self._slots[-1] return self._slots[-1]
elif isinstance(index, (int, long)): elif isinstance(index, (int, long)):
# XXX this implementation is not so good, but rarely used. iterator = self.__iter__()
return tuple(self)[index] for i in xrange(index):
iterator.next()
return iterator.next()
elif isinstance(index, slice): elif isinstance(index, slice):
return self.__class__((self[x] for x in return self.__class__((self[x] for x in
xrange(*index.indices(len(self))))) xrange(*index.indices(len(self)))))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment