Skip to content

Commit 77e8d43

Browse files
committed
pr feedback
1 parent 2091636 commit 77e8d43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

redis/asyncio/cluster.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1569,9 +1569,10 @@ async def _execute(
15691569
raise result
15701570

15711571
default_cluster_node = client.get_default_node()
1572+
1573+
# In some cases, 'client.get_default_node()' may return None. The check below
1574+
# prevents a potential AttributeError.
15721575
if default_cluster_node is not None:
1573-
# Not sure why default_cluster_node is sometimes None; maybe if the object is being
1574-
# closed during an execution? Either way, this avoids a potential AttributeError
15751576
default_node = nodes.get(default_cluster_node.name)
15761577
if default_node is not None:
15771578
# This pipeline execution used the default node, check if we need

0 commit comments

Comments
 (0)