Skip to content

Commit ef4befd

Browse files
authored
Merge branch 'dev' into udp-close-releases-socket
2 parents 74b5534 + 4789354 commit ef4befd

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

pymodbus/transaction/transaction.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,6 @@ async def execute(
224224
return response
225225
except asyncio.exceptions.TimeoutError:
226226
count_retries += 1
227-
except asyncio.exceptions.CancelledError as exc:
228-
raise self._io_exception_from_request(
229-
"Request cancelled outside library.",
230-
request,
231-
) from exc
232227
if self.count_until_disconnect < 0:
233228
self.connection_lost(asyncio.TimeoutError("Server not responding"))
234229
raise self._io_exception_from_request(

test/transaction/test_transaction.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,9 @@ async def test_transaction_execute(self, use_clc, scenario):
247247
await asyncio.sleep(0.1)
248248
resp.cancel()
249249
await asyncio.sleep(0.1)
250-
with pytest.raises(ModbusIOException) as exc_info:
250+
with pytest.raises(asyncio.CancelledError):
251251
await resp
252-
assert exc_info.value.fcode == request.function_code
253-
assert exc_info.value.dev_id == request.dev_id
252+
assert resp.cancelled()
254253
elif scenario == 7: # response
255254
transact.comm_params.timeout_connect = 0.2
256255
resp = asyncio.create_task(transact.execute(False, request))

0 commit comments

Comments
 (0)