diff options
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/cachecontrol/compat.py')
-rw-r--r-- | venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/cachecontrol/compat.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/cachecontrol/compat.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/cachecontrol/compat.py new file mode 100644 index 0000000..e3f3243 --- /dev/null +++ b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/cachecontrol/compat.py | |||
@@ -0,0 +1,29 @@ | |||
1 | try: | ||
2 | from urllib.parse import urljoin | ||
3 | except ImportError: | ||
4 | from urlparse import urljoin | ||
5 | |||
6 | |||
7 | try: | ||
8 | import cPickle as pickle | ||
9 | except ImportError: | ||
10 | import pickle | ||
11 | |||
12 | |||
13 | # Handle the case where the requests module has been patched to not have | ||
14 | # urllib3 bundled as part of its source. | ||
15 | try: | ||
16 | from pip._vendor.requests.packages.urllib3.response import HTTPResponse | ||
17 | except ImportError: | ||
18 | from pip._vendor.urllib3.response import HTTPResponse | ||
19 | |||
20 | try: | ||
21 | from pip._vendor.requests.packages.urllib3.util import is_fp_closed | ||
22 | except ImportError: | ||
23 | from pip._vendor.urllib3.util import is_fp_closed | ||
24 | |||
25 | # Replicate some six behaviour | ||
26 | try: | ||
27 | text_type = unicode | ||
28 | except NameError: | ||
29 | text_type = str | ||