mirror of https://github.com/pypa/pip
Merge pull request #8278 from tiran/py3_celementtree
This commit is contained in:
commit
d01bfcfaa1
|
@ -0,0 +1 @@
|
|||
Vendored htmlib5 no longer imports deprecated xml.etree.cElementTree on Python 3.
|
|
@ -100,8 +100,9 @@ Modifications
|
|||
* ``setuptools`` is completely stripped to only keep ``pkg_resources``
|
||||
* ``pkg_resources`` has been modified to import its dependencies from ``pip._vendor``
|
||||
* ``packaging`` has been modified to import its dependencies from ``pip._vendor``
|
||||
* ``html5lib`` has been modified to import six from ``pip._vendor`` and
|
||||
to prefer importing from ``collections.abc`` instead of ``collections``.
|
||||
* ``html5lib`` has been modified to import six from ``pip._vendor``, to prefer
|
||||
importing from ``collections.abc`` instead of ``collections`` and does not import
|
||||
``xml.etree.cElementTree`` on Python 3.
|
||||
* ``CacheControl`` has been modified to import its dependencies from ``pip._vendor``
|
||||
* ``requests`` has been modified to import its other dependencies from ``pip._vendor``
|
||||
and to *not* load ``simplejson`` (all platforms) and ``pyopenssl`` (Windows).
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue