@@ -9,7 +9,7 @@ import httpx
99import h2.exceptions
1010
1111from .network import get_network, initialize
12−from .client import LOOP
12+from .client import get_loop
1313from .raise_for_httperror import raise_for_httperror
1414
1515# queue.SimpleQueue: Support Python 3.6
@@ -98,7 +98,7 @@ def request(method, url, **kwargs):
9898 network = get_context_network()
9999
100100 # do request
101− future = asyncio.run_coroutine_threadsafe(network.request(method, url, **kwargs), LOOP)
101+ future = asyncio.run_coroutine_threadsafe(network.request(method, url, **kwargs), get_loop())
102102 try:
103103 response = future.result(timeout)
104104 except concurrent.futures.TimeoutError as e:
@@ -179,7 +179,7 @@ def stream(method, url, **kwargs):
179179 """
180180 q = SimpleQueue()
181181 future = asyncio.run_coroutine_threadsafe(stream_chunk_to_queue(get_network(), q, method, url, **kwargs),
182− LOOP)
182+ get_loop())
183183 chunk_or_exception = q.get()
184184 while chunk_or_exception is not None:
185185 if isinstance(chunk_or_exception, Exception):