Skip to content

Commit

Permalink
lsp-devtools: Suppress asyncio.CancelledError
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Nov 23, 2024
1 parent c24938d commit df1ffe3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/lsp-devtools/changes/191.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `lsp-devtools agent` should now suppress `asyncio.CancelledError` exceptions allowing the agent to process to terminate gracefully
5 changes: 4 additions & 1 deletion lib/lsp-devtools/lsp_devtools/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ async def main(args, extra: list[str]):


def run_agent(args, extra: list[str]):
asyncio.run(main(args, extra))
try:
asyncio.run(main(args, extra))
except asyncio.CancelledError:
pass


def cli(commands: argparse._SubParsersAction):
Expand Down

0 comments on commit df1ffe3

Please sign in to comment.