@@ -121,7 +121,7 @@ def __processElementText(self, node, subnode, isText=True):
121
121
childResult = self .__processPlaceholders (text , subnode )
122
122
123
123
if not isText and node is not subnode :
124
- pos = node . getchildren ( ).index (subnode )
124
+ pos = list ( node ).index (subnode )
125
125
node .remove (subnode )
126
126
else :
127
127
pos = 0
@@ -169,7 +169,7 @@ def linkText(text):
169
169
linkText (text )
170
170
171
171
if not isString (node ): # it's Element
172
- for child in [node ] + node . getchildren ( ):
172
+ for child in [node ] + list ( node ):
173
173
if child .tail :
174
174
if child .tail .strip ():
175
175
self .__processElementText (node , child , False )
@@ -224,7 +224,7 @@ def __applyPattern(self, pattern, data, patternIndex, startIndex=0):
224
224
if not isString (node ):
225
225
if not isinstance (node .text , markdown .AtomicString ):
226
226
# We need to process current node too
227
- for child in [node ] + node . getchildren ( ):
227
+ for child in [node ] + list ( node ):
228
228
if not isString (node ):
229
229
if child .text :
230
230
child .text = self .__handleInline (child .text ,
@@ -263,7 +263,7 @@ def run(self, tree):
263
263
while stack :
264
264
currElement = stack .pop ()
265
265
insertQueue = []
266
- for child in currElement . getchildren ( ):
266
+ for child in list ( currElement ):
267
267
if child .text and not isinstance (child .text , markdown .AtomicString ):
268
268
text = child .text
269
269
child .text = None
@@ -272,7 +272,7 @@ def run(self, tree):
272
272
stack += lst
273
273
insertQueue .append ((child , lst ))
274
274
275
- if child . getchildren () :
275
+ if len ( list ( child )) > 0 :
276
276
stack .append (child )
277
277
278
278
for element , lst in insertQueue :
@@ -321,7 +321,7 @@ def run(self, root):
321
321
self ._prettifyETree (root )
322
322
# Do <br />'s seperately as they are often in the middle of
323
323
# inline content and missed by _prettifyETree.
324
- brs = root .getiterator ('br' )
324
+ brs = root .iter ('br' )
325
325
for br in brs :
326
326
if not br .tail or not br .tail .strip ():
327
327
br .tail = '\n '
0 commit comments