| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import urllib3.connection |
| 4 |
|
| 5 |
from ...connectionpool import HTTPConnectionPool, HTTPSConnectionPool |
| 6 |
from .connection import EmscriptenHTTPConnection, EmscriptenHTTPSConnection |
| 7 |
|
| 8 |
|
| 9 |
def inject_into_urllib3() -> None: |
| 10 |
# override connection classes to use emscripten specific classes |
| 11 |
# n.b. mypy complains about the overriding of classes below |
| 12 |
# if it isn't ignored |
| 13 |
HTTPConnectionPool.ConnectionCls = EmscriptenHTTPConnection |
| 14 |
HTTPSConnectionPool.ConnectionCls = EmscriptenHTTPSConnection |
| 15 |
urllib3.connection.HTTPConnection = EmscriptenHTTPConnection # type: ignore[misc,assignment] |
| 16 |
urllib3.connection.HTTPSConnection = EmscriptenHTTPSConnection # type: ignore[misc,assignment] |
| 17 |
urllib3.connection.VerifiedHTTPSConnection = EmscriptenHTTPSConnection # type: ignore[assignment] |