Skip to content

Commit df8f551

Browse files
authored
Rollup merge of #73140 - tmiasko:element-tree, r=GuillaumeGomez
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.
2 parents f844ea1 + 291dce9 commit df8f551

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)