[wdoc] Avoid usage of deprecated xlm elementree getchildren() method 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 28 Jun 2018 10:15:33 +0200
branch3.26
changeset 12331 3cddf6a5473a
parent 12330 6e620df7d4c3
child 12332 45f9d93bba71
[wdoc] Avoid usage of deprecated xlm elementree getchildren() method Use list(node) as suggested by the deprecation warning.
cubicweb/web/views/wdoc.py
--- a/cubicweb/web/views/wdoc.py	Thu Jun 28 09:43:23 2018 +0200
+++ b/cubicweb/web/views/wdoc.py	Thu Jun 28 10:15:33 2018 +0200
@@ -58,7 +58,7 @@
     if section.attrib.get('insertafter'):
         snode = index[section.attrib['insertafter']]
         node = snode.parent
-        idx = node.getchildren().index(snode) + 1
+        idx = list(node).index(snode) + 1
     elif section.attrib.get('insertbefore'):
         snode = index[section.attrib['insertbefore']]
         node = snode.parent