comparison lib/python3.8/site-packages/pip/_vendor/requests/packages.py @ 1:64071f2a4cf0 draft default tip

Deleted selected files
author guerler
date Mon, 27 Jul 2020 03:55:49 -0400
parents 9e54283cc701
children
comparison
equal deleted inserted replaced
0:9e54283cc701 1:64071f2a4cf0
1 import sys
2
3 # This code exists for backwards compatibility reasons.
4 # I don't like it either. Just look the other way. :)
5
6 for package in ('urllib3', 'idna', 'chardet'):
7 vendored_package = "pip._vendor." + package
8 locals()[package] = __import__(vendored_package)
9 # This traversal is apparently necessary such that the identities are
10 # preserved (requests.packages.urllib3.* is urllib3.*)
11 for mod in list(sys.modules):
12 if mod == vendored_package or mod.startswith(vendored_package + '.'):
13 unprefixed_mod = mod[len("pip._vendor."):]
14 sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
15
16 # Kinda cool, though, right?