Skip to content

Commit

Permalink
fix: do not release connection lock unless you have it
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuagruenstein committed Jul 5, 2024
1 parent db2c3d8 commit 53a64b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tcp_modbus_aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ async def send_modbus_message(

return None
finally:
self._comms_lock.release()
if self._comms_lock.locked():
self._comms_lock.release()

response_function = create_function_from_response_pdu(
response_pdu, request_function
Expand Down

0 comments on commit 53a64b3

Please sign in to comment.