summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorq0w <43147888+q0w@users.noreply.github.com>2022-03-27 16:25:41 +0300
committerq0w <43147888+q0w@users.noreply.github.com>2022-03-27 16:25:41 +0300
commit6689e531d304d24ed0d34bd37b9073fb40ba7ce9 (patch)
tree68585a3486dd57c6704abecd3569ee8b545cf08e /tools
parent7d618830001c827b9e72e7514e98b66fd7625e7c (diff)
downloadpip-6689e531d304d24ed0d34bd37b9073fb40ba7ce9.tar.gz
Disable brotli import in urllib3
Diffstat (limited to 'tools')
-rw-r--r--tools/vendoring/patches/urllib3.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/tools/vendoring/patches/urllib3.patch b/tools/vendoring/patches/urllib3.patch
index 3ca7226fa..747b81e1d 100644
--- a/tools/vendoring/patches/urllib3.patch
+++ b/tools/vendoring/patches/urllib3.patch
@@ -27,3 +27,37 @@ index c43146279..4cded53f6 100644
+ pyopenssl.inject_into_urllib3()
except ImportError:
pass
+
+diff --git a/src/pip/_vendor/urllib3/response.py b/src/pip/_vendor/urllib3/response.py
+index 38693f4fc..776e49dd2 100644
+--- a/src/pip/_vendor/urllib3/response.py
++++ b/src/pip/_vendor/urllib3/response.py
+@@ -7,10 +7,7 @@ from contextlib import contextmanager
+ from socket import error as SocketError
+ from socket import timeout as SocketTimeout
+
+-try:
+- import brotli
+-except ImportError:
+- brotli = None
++brotli = None
+
+ from ._collections import HTTPHeaderDict
+ from .connection import BaseSSLError, HTTPException
+diff --git a/src/pip/_vendor/urllib3/util/request.py b/src/pip/_vendor/urllib3/util/request.py
+index 25103383e..330766ef4 100644
+--- a/src/pip/_vendor/urllib3/util/request.py
++++ b/src/pip/_vendor/urllib3/util/request.py
+@@ -13,12 +13,6 @@ SKIP_HEADER = "@@@SKIP_HEADER@@@"
+ SKIPPABLE_HEADERS = frozenset(["accept-encoding", "host", "user-agent"])
+
+ ACCEPT_ENCODING = "gzip,deflate"
+-try:
+- import brotli as _unused_module_brotli # noqa: F401
+-except ImportError:
+- pass
+-else:
+- ACCEPT_ENCODING += ",br"
+
+ _FAILEDTELL = object()
+