Skip to content

Commit d514ea1

Browse files
committed
pr feedback
1 parent 2091636 commit d514ea1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

redis/asyncio/cluster.py

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

15711571
default_cluster_node = client.get_default_node()
1572+
1573+
# Check whether the default node was used. In some cases,
1574+
# 'client.get_default_node()' may return None. The check below
1575+
# prevents a potential AttributeError.
15721576
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
15751577
default_node = nodes.get(default_cluster_node.name)
15761578
if default_node is not None:
15771579
# This pipeline execution used the default node, check if we need

0 commit comments

Comments
 (0)