diff --git a/src/pip/_vendor/html5lib/_utils.py b/src/pip/_vendor/html5lib/_utils.py index 0703afb38b1..96eb17b2c17 100644 --- a/src/pip/_vendor/html5lib/_utils.py +++ b/src/pip/_vendor/html5lib/_utils.py @@ -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",