]> git.lizzy.rs Git - rust.git/commitdiff
Fallback to xml.etree.ElementTree
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Mon, 8 Jun 2020 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Mon, 8 Jun 2020 18:35:56 +0000 (20:35 +0200)
The xml.etree.cElementTree has been deprecated since Python 3.3
and removed in Python 3.9 https://bugs.python.org/issue36543.

src/etc/htmldocck.py

index 7789b24b62c83be1ce1297ebf08893e0bc611805..2e7958325cd61e975b1027a1e6e8765452181631 100644 (file)
@@ -114,7 +114,10 @@ try:
     from html.parser import HTMLParser
 except ImportError:
     from HTMLParser import HTMLParser
-from xml.etree import cElementTree as ET
+try:
+    from xml.etree import cElementTree as ET
+except ImportError:
+    from xml.etree import ElementTree as ET
 
 try:
     from html.entities import name2codepoint