Skip to content

Commit 578b170

Browse files
author
A. Jesse Jiryu Davis
committed
More Pool code clarification. PYTHON-537
1 parent c6be7ae commit 578b170

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymongo/mongo_replica_set_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,8 @@ def __send_and_receive(self, member, msg, **kwargs):
14241424
sock_info.close()
14251425
raise
14261426
finally:
1427-
member.pool.maybe_return_socket(sock_info)
1427+
if sock_info:
1428+
member.pool.maybe_return_socket(sock_info)
14281429

14291430
def __try_read(self, member, msg, **kwargs):
14301431
"""Attempt a read from a member; on failure mark the member "down" and

0 commit comments

Comments
 (0)