Skip to content

Commit 291dce9

Browse files
committed
Fallback to xml.etree.ElementTree
The xml.etree.cElementTree has been deprecated since Python 3.3 and removed in Python 3.9 https://bugs.python.org/issue36543.
1 parent 7355816 commit 291dce9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/etc/htmldocck.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@
114114
from html.parser import HTMLParser
115115
except ImportError:
116116
from HTMLParser import HTMLParser
117-
from xml.etree import cElementTree as ET
117+
try:
118+
from xml.etree import cElementTree as ET
119+
except ImportError:
120+
from xml.etree import ElementTree as ET
118121

119122
try:
120123
from html.entities import name2codepoint

0 commit comments

Comments
 (0)