-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support strict_exception_groups=True (#188)
Fixes #132 and #187 * Changes `open_websocket` to only raise a single exception, even when running under `strict_exception_groups=True` * [ ] Should maybe introduce special handling for `KeyboardInterrupt`s * If multiple non-Cancelled-exceptions are encountered, then it will raise `TrioWebSocketInternalError` with the exceptiongroup as its `__cause__`. This should only be possible if the background task and the user context both raise exceptions. This would previously raise a `MultiError` with both Exceptions. * other alternatives could include throwing out the exception from the background task, raising an ExceptionGroup with both errors, or trying to do something fancy with `__cause__` or `__context__`. * `WebSocketServer.run` and `WebSocketServer._handle_connection` are the other two places that opens a nursery. I've opted not to change these, since I don't think user code should expect any special exceptions from it, and it seems less obscure that it might contain an internal nursery. * [ ] Update docstrings to mention existence of internal nursery.
- Loading branch information
Showing
6 changed files
with
238 additions
and
19 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ pip-tools>=5.5.0 | |
pytest>=4.6 | ||
pytest-cov | ||
pytest-trio>=0.5.0 | ||
trio<0.25 | ||
trustme |
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
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