diff options
Diffstat (limited to 'gbp/rpm/linkedlist.py')
-rw-r--r-- | gbp/rpm/linkedlist.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gbp/rpm/linkedlist.py b/gbp/rpm/linkedlist.py index 74d897bc..0840fef6 100644 --- a/gbp/rpm/linkedlist.py +++ b/gbp/rpm/linkedlist.py @@ -63,8 +63,8 @@ class LinkedListNode(object): def delete(self): """Delete node""" if self.prev: - self.prev.next = self.next - if self.next: + self.prev.next = self.__next__ + if self.__next__: self.next.prev = self.prev self._data = None @@ -75,10 +75,10 @@ class LinkedListIterator(collections.Iterator): def __init__(self, obj): self._next = obj.first - def next(self): + def __next__(self): ret = self._next if ret: - self._next = ret.next + self._next = ret.__next__ else: raise StopIteration return ret @@ -171,8 +171,8 @@ class LinkedList(collections.Iterable): >>> [str(data) for data in list] ['foo', 'baz', 'bar'] """ - new = LinkedListNode(data, prev_node=node, next_node=node.next) - if node.next: + new = LinkedListNode(data, prev_node=node, next_node=node.__next__) + if node.__next__: node.next.prev = new else: self._last = new @@ -205,7 +205,7 @@ class LinkedList(collections.Iterable): """ ret = node.prev if node is self._first: - ret = self._first = self._first.next + ret = self._first = self._first.__next__ if node is self._last: self._last = self._last.prev node.delete() |