@@ -4,6 +4,7 @@ import asyncio
44import threading
55import concurrent.futures
66from time import time
7+from queue import SimpleQueue
78
89import httpx
910import h2.exceptions
@@ -12,29 +13,6 @@ from .network import get_network, initialize, check_network_configuration
1213from .client import get_loop
1314from .raise_for_httperror import raise_for_httperror
1415
15−# queue.SimpleQueue: Support Python 3.6
16−try:
17− from queue import SimpleQueue
18−except ImportError:
19− from queue import Empty
20− from collections import deque
21−
22− class SimpleQueue:
23− """Minimal backport of queue.SimpleQueue"""
24−
25− def __init__(self):
26− self._queue = deque()
27− self._count = threading.Semaphore(0)
28−
29− def put(self, item):
30− self._queue.append(item)
31− self._count.release()
32−
33− def get(self):
34− if not self._count.acquire(True):
35− raise Empty
36− return self._queue.popleft()
37−
3816
3917THREADLOCAL = threading.local()
4018