Skip to content
Myr

Merge pull request #6562 from amkarn258/issue-6223

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

every chardet package maps to requests.packages.chardet.* package respectively

authored by Ian Stapleton Cordasco · committed by GitHub · parents f3f2611, 89cde23 · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:src/requests/packages.py+4 added-2 removed
21 unmodified lines
2223target = chardet.__name__24for mod in list(sys.modules):25 if mod == target or mod.startswith(f"{target}."):26 target = target.replace(target, "chardet")27 sys.modules[f"requests.packages.{target}"] = sys.modules[mod]26 imported_mod = sys.modules[mod]27 sys.modules[f"requests.packages.{mod}"] = imported_mod28 mod = mod.replace(target, "chardet")29 sys.modules[f"requests.packages.{mod}"] = imported_mod30# Kinda cool, though, right?