Merge pull request #271 from louiz/develop
Use strings for ElementTree.iterparse events names
This commit is contained in:
commit
c183fd5e35
@ -1498,8 +1498,8 @@ class XMLStream(object):
|
|||||||
"""
|
"""
|
||||||
depth = 0
|
depth = 0
|
||||||
root = None
|
root = None
|
||||||
for event, xml in ET.iterparse(self.filesocket, (b'end', b'start')):
|
for event, xml in ET.iterparse(self.filesocket, ('end', 'start')):
|
||||||
if event == b'start':
|
if event == 'start':
|
||||||
if depth == 0:
|
if depth == 0:
|
||||||
# We have received the start of the root element.
|
# We have received the start of the root element.
|
||||||
root = xml
|
root = xml
|
||||||
@ -1516,7 +1516,7 @@ class XMLStream(object):
|
|||||||
# exponential backoff for new reconnect attempts.
|
# exponential backoff for new reconnect attempts.
|
||||||
self.reconnect_delay = 1.0
|
self.reconnect_delay = 1.0
|
||||||
depth += 1
|
depth += 1
|
||||||
if event == b'end':
|
if event == 'end':
|
||||||
depth -= 1
|
depth -= 1
|
||||||
if depth == 0:
|
if depth == 0:
|
||||||
# The stream's root element has closed,
|
# The stream's root element has closed,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user