jpayne@7: from __future__ import annotations jpayne@7: jpayne@7: import urllib3.connection jpayne@7: jpayne@7: from ...connectionpool import HTTPConnectionPool, HTTPSConnectionPool jpayne@7: from .connection import EmscriptenHTTPConnection, EmscriptenHTTPSConnection jpayne@7: jpayne@7: jpayne@7: def inject_into_urllib3() -> None: jpayne@7: # override connection classes to use emscripten specific classes jpayne@7: # n.b. mypy complains about the overriding of classes below jpayne@7: # if it isn't ignored jpayne@7: HTTPConnectionPool.ConnectionCls = EmscriptenHTTPConnection jpayne@7: HTTPSConnectionPool.ConnectionCls = EmscriptenHTTPSConnection jpayne@7: urllib3.connection.HTTPConnection = EmscriptenHTTPConnection # type: ignore[misc,assignment] jpayne@7: urllib3.connection.HTTPSConnection = EmscriptenHTTPSConnection # type: ignore[misc,assignment]