summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPradyun Gedam <pradyunsg@gmail.com>2020-05-30 17:07:10 +0530
committerGitHub <noreply@github.com>2020-05-30 17:07:10 +0530
commitd01bfcfaa13a4f06fa0ce61fa18cf06012f2e78f (patch)
treea1d9233c8c9dd50fa415257172771e39ba545642 /tools
parent7ed5e12ae83ef90ac33be33555ea52f61457c1d2 (diff)
parenta731989b0f4467f725f6bda521ed6a09568f6993 (diff)
downloadpip-d01bfcfaa13a4f06fa0ce61fa18cf06012f2e78f.tar.gz
Merge pull request #8278 from tiran/py3_celementtree
Diffstat (limited to 'tools')
-rw-r--r--tools/automation/vendoring/patches/html5lib.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/automation/vendoring/patches/html5lib.patch b/tools/automation/vendoring/patches/html5lib.patch
index 92a34e4b2..ae9cafe2d 100644
--- a/tools/automation/vendoring/patches/html5lib.patch
+++ b/tools/automation/vendoring/patches/html5lib.patch
@@ -28,4 +28,28 @@ index dcfac220..d8b53004 100644
+ from collections import MutableMapping
from xml.dom import minidom, Node
import weakref
+
+diff --git a/src/pip/_vendor/html5lib/_utils.py b/src/pip/_vendor/html5lib/_utils.py
+index 0703afb3..96eb17b2 100644
+--- a/src/pip/_vendor/html5lib/_utils.py
++++ b/src/pip/_vendor/html5lib/_utils.py
+@@ -2,12 +2,15 @@ from __future__ import absolute_import, division, unicode_literals
+ 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",