try:fromurllib.parseimporturljoinexceptImportError:fromurlparseimporturljointry:importcPickleaspickleexceptImportError:importpickle# Handle the case where the requests module has been patched to not have# urllib3 bundled as part of its source.try:frompip._vendor.requests.packages.urllib3.responseimportHTTPResponseexceptImportError:frompip._vendor.urllib3.responseimportHTTPResponsetry:frompip._vendor.requests.packages.urllib3.utilimportis_fp_closedexceptImportError:frompip._vendor.urllib3.utilimportis_fp_closed# Replicate some six behaviourtry:text_type=unicodeexceptNameError:text_type=str