Skip to content

Commit dca114d

Browse files
committed
Reformat __del__()
1 parent c65d043 commit dca114d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

redis/asyncio/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,9 @@ async def __aexit__(self, exc_type, exc_value, traceback):
535535
# passing _warnings and _grl as argument default since they may be gone
536536
# by the time __del__ is called at shutdown
537537
def __del__(
538-
self, _warn: Any = warnings.warn, _grl: Any = asyncio.get_running_loop
538+
self,
539+
_warn: Any = warnings.warn,
540+
_grl: Any = asyncio.get_running_loop,
539541
) -> None:
540542
if hasattr(self, "connection") and (self.connection is not None):
541543
_warn(f"Unclosed client session {self!r}", ResourceWarning, source=self)

redis/asyncio/cluster.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ def __await__(self) -> Generator[Any, None, "RedisCluster"]:
434434
_DEL_MESSAGE = "Unclosed RedisCluster client"
435435

436436
def __del__(
437-
self, _warn: Any = warnings.warn, _grl: Any = asyncio.get_running_loop
437+
self,
438+
_warn: Any = warnings.warn,
439+
_grl: Any = asyncio.get_running_loop,
438440
) -> None:
439441
if hasattr(self, "_initialize") and not self._initialize:
440442
_warn(f"{self._DEL_MESSAGE} {self!r}", ResourceWarning, source=self)
@@ -972,7 +974,9 @@ def __eq__(self, obj: Any) -> bool:
972974
_DEL_MESSAGE = "Unclosed ClusterNode object"
973975

974976
def __del__(
975-
self, _warn: Any = warnings.warn, _grl: Any = asyncio.get_running_loop
977+
self,
978+
_warn: Any = warnings.warn,
979+
_grl: Any = asyncio.get_running_loop,
976980
) -> None:
977981
for connection in self._connections:
978982
if connection.is_connected:

0 commit comments

Comments
 (0)