Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pip/_vendor/cachecontrol/compat.py: 70%

20 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-07 06:48 +0000

1# SPDX-FileCopyrightText: 2015 Eric Larson 

2# 

3# SPDX-License-Identifier: Apache-2.0 

4 

5try: 

6 from urllib.parse import urljoin 

7except ImportError: 

8 from urlparse import urljoin 

9 

10 

11try: 

12 import cPickle as pickle 

13except 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. 

18try: 

19 from pip._vendor.requests.packages.urllib3.response import HTTPResponse 

20except ImportError: 

21 from pip._vendor.urllib3.response import HTTPResponse 

22 

23try: 

24 from pip._vendor.requests.packages.urllib3.util import is_fp_closed 

25except ImportError: 

26 from pip._vendor.urllib3.util import is_fp_closed 

27 

28# Replicate some six behaviour 

29try: 

30 text_type = unicode 

31except NameError: 

32 text_type = str