This gives us the expected test skipping when httpx isn't available
or is too old, vs. the test failures that were happening before
this change.
_have_httpx = False
_have_http2 = False
try:
+ import httpcore
+ import httpcore._backends.sync
import httpx
+ _CoreNetworkBackend = httpcore.NetworkBackend
+ _CoreSyncStream = httpcore._backends.sync.SyncStream
+
_have_httpx = True
try:
# See if http2 support is available.
except Exception:
pass
- import httpcore
- import httpcore._backends.sync
-
- _CoreNetworkBackend = httpcore.NetworkBackend
- _CoreSyncStream = httpcore._backends.sync.SyncStream
-
class _NetworkBackend(_CoreNetworkBackend):
def __init__(self, resolver, local_port, bootstrap_address, family):
super().__init__()