Skip to content

Commit e9136f4

Browse files
authored
PYTHON-1313 Fix asyncio removals in Python 3.10 (#1179)
1 parent a7ab8cc commit e9136f4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cassandra/io/asyncioreactor.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ def end(self):
4141

4242
def __init__(self, timeout, callback, loop):
4343
delayed = self._call_delayed_coro(timeout=timeout,
44-
callback=callback,
45-
loop=loop)
44+
callback=callback)
4645
self._handle = asyncio.run_coroutine_threadsafe(delayed, loop=loop)
4746

4847
@staticmethod
49-
async def _call_delayed_coro(timeout, callback, loop):
50-
await asyncio.sleep(timeout, loop=loop)
48+
async def _call_delayed_coro(timeout, callback):
49+
await asyncio.sleep(timeout)
5150
return callback()
5251

5352
def __lt__(self, other):
@@ -90,8 +89,8 @@ def __init__(self, *args, **kwargs):
9089
self._connect_socket()
9190
self._socket.setblocking(0)
9291

93-
self._write_queue = asyncio.Queue(loop=self._loop)
94-
self._write_queue_lock = asyncio.Lock(loop=self._loop)
92+
self._write_queue = asyncio.Queue()
93+
self._write_queue_lock = asyncio.Lock()
9594

9695
# see initialize_reactor -- loop is running in a separate thread, so we
9796
# have to use a threadsafe call

0 commit comments

Comments
 (0)