-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve termination of Application. Don't ever suppress CancelledError.
This fixes a race condition when the prompt_toolkit Application gets cancelled while waiting for the background tasks to complete. Catching `CancelledError` at this point caused any code following the `Application.run_async` to continue, instead of being cancelled. In the future, we should probably adapt task groups (from anyio or Python 3.11), but until then, this is sufficient.
- Loading branch information
1 parent
0ddf173
commit 427f4bc
Showing
2 changed files
with
64 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters