[PATCH 4 of 9 3.26] [wdoc] Remove fallback about xml.etree module

Denis Laxalde denis.laxalde at logilab.fr
Thu Jun 28 12:28:31 CEST 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1530175084 -7200
#      Thu Jun 28 10:38:04 2018 +0200
# Branch 3.26
# Node ID 45f9d93bba712769e98d22e2192603be159e9b4a
# Parent  3cddf6a5473ab4563151758722d295fd0d93a61e
# Available At https://hg.logilab.org/review/cubicweb
#              hg pull https://hg.logilab.org/review/cubicweb -r 45f9d93bba71
# EXP-Topic py3
[wdoc] Remove fallback about xml.etree module

Module xml.etree exists since python 2.5.

diff --git a/cubicweb/web/views/wdoc.py b/cubicweb/web/views/wdoc.py
--- a/cubicweb/web/views/wdoc.py
+++ b/cubicweb/web/views/wdoc.py
@@ -23,6 +23,7 @@ CubicWeb and cubes
 
 from itertools import chain
 from os.path import join
+from xml.etree.ElementTree import parse
 
 from six import text_type
 
@@ -36,11 +37,6 @@ from cubicweb import _
 
 # table of content management #################################################
 
-try:
-    from xml.etree.ElementTree import parse
-except ImportError:
-    from elementtree.ElementTree import parse
-
 
 def build_toc_index(node, index):
     try:


More information about the cubicweb-devel mailing list