Skip to content

Commit

Permalink
Merge pull request #107 from ska-sa/async-timeout-fix
Browse files Browse the repository at this point in the history
Fix use of async_timeout
  • Loading branch information
bmerry authored Jan 16, 2025
2 parents e78ce3b + 948a165 commit 91e313f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aiokatcp/tools/katcpcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def async_main() -> int:
assert current_task is not None
asyncio.get_event_loop().add_signal_handler(signal.SIGINT, current_task.cancel)
try:
with async_timeout.timeout(args.connect_timeout):
async with async_timeout.timeout(args.connect_timeout):
client = await CmdClient.connect(host, port, auto_reconnect=False)
except (OSError, aiokatcp.client.ProtocolError) as error:
logging.error("Connection error: %s", error)
Expand All @@ -89,7 +89,7 @@ async def async_main() -> int:
return 1
async with client:
try:
with async_timeout.timeout(args.request_timeout):
async with async_timeout.timeout(args.request_timeout):
reply, informs = await client.request_raw(args.command, *args.args)
except (OSError, aiokatcp.client.ProtocolError) as error:
logging.error("Connection error: %s", error)
Expand Down

0 comments on commit 91e313f

Please sign in to comment.