From bdf1f19feeda0953d30447d7ee4adbbf78a89d8b Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Wed, 20 Mar 2002 23:56:34 +0000 Subject: [PATCH] [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) --- Lib/xml/dom/pulldom.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py index adc978e9a99..255689c4887 100644 --- a/Lib/xml/dom/pulldom.py +++ b/Lib/xml/dom/pulldom.py @@ -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]