[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)
diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py
index adc978e..255689c 100644
--- a/Lib/xml/dom/pulldom.py
+++ b/Lib/xml/dom/pulldom.py
@@ -227,6 +227,15 @@
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]