| Index: third_party/logilab/common/visitor.py
|
| ===================================================================
|
| --- third_party/logilab/common/visitor.py (revision 292986)
|
| +++ third_party/logilab/common/visitor.py (working copy)
|
| @@ -35,12 +35,14 @@
|
| filter_func = no_filter
|
| self._list = list_func(node, filter_func)
|
|
|
| - def next(self):
|
| + def __next__(self):
|
| try:
|
| return self._list.pop(0)
|
| except :
|
| return None
|
|
|
| + next = __next__
|
| +
|
| # Base Visitor ################################################################
|
| class Visitor(object):
|
|
|
| @@ -61,10 +63,10 @@
|
|
|
| def _visit(self, node):
|
| iterator = self._get_iterator(node)
|
| - n = iterator.next()
|
| + n = next(iterator)
|
| while n:
|
| result = n.accept(self)
|
| - n = iterator.next()
|
| + n = next(iterator)
|
| return result
|
|
|
| def _get_iterator(self, node):
|
|
|