mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00: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
1 changed files with 9 additions and 0 deletions
|
@ -227,6 +227,15 @@ class DOMEventStream:
|
||||||
return rc
|
return rc
|
||||||
raise IndexError
|
raise IndexError
|
||||||
|
|
||||||
|
def next(self):
|
||||||
|
rc = self.getEvent()
|
||||||
|
if rc:
|
||||||
|
return rc
|
||||||
|
raise StopIteration
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return self
|
||||||
|
|
||||||
def expandNode(self, node):
|
def expandNode(self, node):
|
||||||
event = self.getEvent()
|
event = self.getEvent()
|
||||||
parents = [node]
|
parents = [node]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue