Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor bugs in defer_to_cancelled() #1

Open
belm0 opened this issue Sep 4, 2019 · 1 comment
Open

minor bugs in defer_to_cancelled() #1

belm0 opened this issue Sep 4, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@belm0
Copy link
Contributor

belm0 commented Sep 4, 2019

njs noticed a bug in early exit:

that early exit on line 84 is wrong btw... it won't notice the Cancelled in MultiError([RuntimeError, MultiError([Cancelled, Cancelled])])

if not any(isinstance(exc, trio.Cancelled) for exc in exceptions):
raise

also this function may be adding unnecessary context on exceptions:

those raise statements will automatically attach the original MultiError object as a context

could do a __context__ dance along the lines of MultiError.catch() internals

@belm0 belm0 added the bug Something isn't working label Sep 4, 2019
belm0 added a commit that referenced this issue Jun 29, 2020
the existing defer_to_cancelled(), which had a bug with nested MultiError (#1),
is now implemented with the new function
@belm0
Copy link
Contributor Author

belm0 commented Jun 29, 2020

that early exit on line 84 is wrong btw... it won't notice the Cancelled in MultiError([RuntimeError, MultiError([Cancelled, Cancelled])])

fixed in 58db781

those raise statements will automatically attach the original MultiError object as a context

I haven't looked at this yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant