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>
  • Loading branch information
tiran committed May 20, 2020
1 parent 9999f0e commit bf31e53
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pip/_vendor/html5lib/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

from types import ModuleType

from pip._vendor.six import text_type
from pip._vendor.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 bf31e53

Please sign in to comment.