mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
[Apply patch #500457 from the PyXML tracker]
Add iterator support to pulldom.DOMEventStream New feature, so not a bugfix candidate (though it should be safe for inclusion)
This commit is contained in:
parent
3afb2d2bba
commit
bdf1f19fee
@ -227,6 +227,15 @@ class DOMEventStream:
|
||||
return rc
|
||||
raise IndexError
|
||||
|
||||
def next(self):
|
||||
rc = self.getEvent()
|
||||
if rc:
|
||||
return rc
|
||||
raise StopIteration
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def expandNode(self, node):
|
||||
event = self.getEvent()
|
||||
parents = [node]
|
||||
|
Loading…
Reference in New Issue
Block a user