Skip to content
Myr

Merge pull request #4103 from untitaker/issue4102

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Preserve identity of unbundled deps

authored by Kenneth Reitz · committed by GitHub · parents 593cd18, 588e8f7 · Browse files · 1 file+8 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−9 removed

  • other:+8 added−9 removed

1 file+8 added−9 removed

modified:requests/packages.py+8 added-9 removed
1 unmodified line
23# This code exists for backwards compatibility reasons.4# I don't like it either. Just look the other way. :)56import urllib37sys.modules['requests.packages.urllib3'] = urllib36for package in ('urllib3', 'idna', 'chardet'):7 __import__(package)8 # This traversal is apparently necessary such that the identities are9 # preserved (requests.packages.urllib3.* is urllib3.*)10 for mod in list(sys.modules):11 if mod == package or mod.startswith(package + '.'):12 sys.modules['requests.packages.' + mod] = sys.modules[mod]139import idna10sys.modules['requests.packages.idna'] = idna1112import chardet13sys.modules['requests.packages.chardet'] = chardet1415# Kinda cool, though, right?14# Kinda cool, though, right?