Skip to content

Commit c64bdb9

Browse files
committed
Reformat __del__()
1 parent 044aa9d commit c64bdb9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

redis/asyncio/client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ async def __aexit__(self, exc_type, exc_value, traceback):
492492
# passing _warnings and _grl as argument default since they may be gone
493493
# by the time __del__ is called at shutdown
494494
def __del__(
495-
self, _warn: Any = warnings.warn, _grl: Any = asyncio.get_running_loop
495+
self,
496+
_warn: Any = warnings.warn,
497+
_grl: Any = asyncio.get_running_loop,
496498
) -> None:
497499
if hasattr(self, "connection") and (self.connection is not None):
498500
_warn(f"Unclosed client session {self!r}", ResourceWarning, source=self)

redis/asyncio/cluster.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,9 @@ def __await__(self) -> Generator[Any, None, "RedisCluster"]:
423423
_DEL_MESSAGE = "Unclosed RedisCluster client"
424424

425425
def __del__(
426-
self, _warn: Any = warnings.warn, _grl: Any = asyncio.get_running_loop
426+
self,
427+
_warn: Any = warnings.warn,
428+
_grl: Any = asyncio.get_running_loop,
427429
) -> None:
428430
if hasattr(self, "_initialize") and not self._initialize:
429431
_warn(f"{self._DEL_MESSAGE} {self!r}", ResourceWarning, source=self)
@@ -961,7 +963,9 @@ def __eq__(self, obj: Any) -> bool:
961963
_DEL_MESSAGE = "Unclosed ClusterNode object"
962964

963965
def __del__(
964-
self, _warn: Any = warnings.warn, _grl: Any = asyncio.get_running_loop
966+
self,
967+
_warn: Any = warnings.warn,
968+
_grl: Any = asyncio.get_running_loop,
965969
) -> None:
966970
for connection in self._connections:
967971
if connection.is_connected:

0 commit comments

Comments
 (0)