python (3.12.0)
1 # SPDX-FileCopyrightText: 2015 Eric Larson
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 try:
6 from urllib.parse import urljoin
7 except ImportError:
8 from urlparse import urljoin
9
10
11 try:
12 import cPickle as pickle
13 except ImportError:
14 import pickle
15
16 # Handle the case where the requests module has been patched to not have
17 # urllib3 bundled as part of its source.
18 try:
19 from pip._vendor.requests.packages.urllib3.response import HTTPResponse
20 except ImportError:
21 from pip._vendor.urllib3.response import HTTPResponse
22
23 try:
24 from pip._vendor.requests.packages.urllib3.util import is_fp_closed
25 except ImportError:
26 from pip._vendor.urllib3.util import is_fp_closed
27
28 # Replicate some six behaviour
29 try:
30 text_type = unicode
31 except NameError:
32 text_type = str