diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-05-27 09:03:46 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-05-27 09:09:22 +0200 |
commit | 18d83d5273cb0764d66170a90033219b4e96e05b (patch) | |
tree | 606ae0b569d7261407802fc5b08f2e42386593ee | |
parent | e73264c3ee550c517e05dfe3f2d9b59068cf3601 (diff) |
Use __next__() instead of next()
for Python3 compatibility
-rw-r--r-- | gbp/rpm/linkedlist.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gbp/rpm/linkedlist.py b/gbp/rpm/linkedlist.py index bc1df4cb..3f619386 100644 --- a/gbp/rpm/linkedlist.py +++ b/gbp/rpm/linkedlist.py @@ -75,7 +75,7 @@ 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 @@ -83,6 +83,9 @@ class LinkedListIterator(collections.Iterator): raise StopIteration return ret + def next(self): + return self.__next__() + class LinkedList(collections.Iterable): """Doubly linked list""" |