Skip to content

Commit

Permalink
Don't use cElementTree on Python 3
Browse files Browse the repository at this point in the history
It's been deprecated and will be removed in 3.9 or 3.10. 3.9.0b1 doesn't
have cElementTree. I'd like to bring it back with a deprecation warning
to drop in 3.10.

See: python/cpython#19921
Signed-off-by: Christian Heimes <christian@python.org>
Signed-off-by: Sam Sneddon <me@gsnedders.com>
  • Loading branch information
tiran authored and gsnedders committed Jun 17, 2020
1 parent b2b08cc commit e4ff95f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions html5lib/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
except ImportError:
from collections import Mapping

from six import text_type
from six import text_type, PY3

try:
import xml.etree.cElementTree as default_etree
except ImportError:
if PY3:
import xml.etree.ElementTree as default_etree
else:
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree


__all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair",
Expand Down

0 comments on commit e4ff95f

Please sign in to comment.