mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-19 14:50:07 +03:00
Fix tree iterators broken by 2to3 script
This commit is contained in:
parent
2cb6bf8eb0
commit
87f3287d9b
@ -528,7 +528,7 @@ class xmlCoreDepthFirstItertor:
|
||||
self.parents = []
|
||||
def __iter__(self):
|
||||
return self
|
||||
def __next__(self):
|
||||
def next(self):
|
||||
while 1:
|
||||
if self.node:
|
||||
ret = self.node
|
||||
@ -539,7 +539,7 @@ class xmlCoreDepthFirstItertor:
|
||||
parent = self.parents.pop()
|
||||
except IndexError:
|
||||
raise StopIteration
|
||||
self.node = parent.__next__
|
||||
self.node = parent.next
|
||||
|
||||
#
|
||||
# implements the breadth-first iterator for libxml2 DOM tree
|
||||
@ -550,12 +550,12 @@ class xmlCoreBreadthFirstItertor:
|
||||
self.parents = []
|
||||
def __iter__(self):
|
||||
return self
|
||||
def __next__(self):
|
||||
def next(self):
|
||||
while 1:
|
||||
if self.node:
|
||||
ret = self.node
|
||||
self.parents.append(self.node)
|
||||
self.node = self.node.__next__
|
||||
self.node = self.node.next
|
||||
return ret
|
||||
try:
|
||||
parent = self.parents.pop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user