Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pymodbus/transaction/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ async def execute(
return response
except asyncio.exceptions.TimeoutError:
count_retries += 1
except asyncio.exceptions.CancelledError as exc:
raise self._io_exception_from_request(
"Request cancelled outside library.",
request,
) from exc
if self.count_until_disconnect < 0:
self.connection_lost(asyncio.TimeoutError("Server not responding"))
raise self._io_exception_from_request(
Expand Down
5 changes: 2 additions & 3 deletions test/transaction/test_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ async def test_transaction_execute(self, use_clc, scenario):
await asyncio.sleep(0.1)
resp.cancel()
await asyncio.sleep(0.1)
with pytest.raises(ModbusIOException) as exc_info:
with pytest.raises(asyncio.CancelledError):
await resp
assert exc_info.value.fcode == request.function_code
assert exc_info.value.dev_id == request.dev_id
assert resp.cancelled()
elif scenario == 7: # response
transact.comm_params.timeout_connect = 0.2
resp = asyncio.create_task(transact.execute(False, request))
Expand Down