comparison lib/python3.8/site-packages/pip/_vendor/requests/packages.py @ 0:9e54283cc701 draft

"planemo upload commit d12c32a45bcd441307e632fca6d9af7d60289d44"
author guerler
date Mon, 27 Jul 2020 03:47:31 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:9e54283cc701
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?