From 41fd1a90e044c792c66da212f48b760a8e217020 Mon Sep 17 00:00:00 2001 From: Sam Hughes Date: Wed, 4 Oct 2023 14:06:24 -0700 Subject: [PATCH 1/2] Replace "is not" against empty string with "!=" Silences warning (or perhaps legit error, now) --- rethinkdb/asyncio_net/net_asyncio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rethinkdb/asyncio_net/net_asyncio.py b/rethinkdb/asyncio_net/net_asyncio.py index 781081e5..2f9152ac 100644 --- a/rethinkdb/asyncio_net/net_asyncio.py +++ b/rethinkdb/asyncio_net/net_asyncio.py @@ -227,7 +227,7 @@ def connect(self, timeout): break # This may happen in the `V1_0` protocol where we send two requests as # an optimization, then need to read each separately - if request is not "": + if request != "": self._streamwriter.write(request) response = yield from asyncio.wait_for( From 10e95456f6ff0cba1d13ab1d85699cda1bbebdf5 Mon Sep 17 00:00:00 2001 From: Sam Hughes Date: Wed, 4 Oct 2023 14:07:07 -0700 Subject: [PATCH 2/2] Remove loop parameters that are not used in 3.10 In Python 3.9, they are optional, and we default to the active event loop. --- rethinkdb/asyncio_net/net_asyncio.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rethinkdb/asyncio_net/net_asyncio.py b/rethinkdb/asyncio_net/net_asyncio.py index 2f9152ac..73cbcdd7 100644 --- a/rethinkdb/asyncio_net/net_asyncio.py +++ b/rethinkdb/asyncio_net/net_asyncio.py @@ -75,7 +75,7 @@ def wait(future): new_timeout = max(deadline - loop.time(), 0) else: new_timeout = None - return (yield from asyncio.wait_for(future, new_timeout, loop=loop)) + return (yield from asyncio.wait_for(future, new_timeout)) return wait @@ -202,7 +202,6 @@ def connect(self, timeout): self._streamreader, self._streamwriter = yield from asyncio.open_connection( self._parent.host, self._parent.port, - loop=self._io_loop, ssl=ssl_context, ) self._streamwriter.get_extra_info("socket").setsockopt( @@ -233,7 +232,6 @@ def connect(self, timeout): response = yield from asyncio.wait_for( _read_until(self._streamreader, b"\0"), timeout, - loop=self._io_loop, ) response = response[:-1] except ReqlAuthError: