Uh oh!
There was an error while loading. Please reload this page.
Avoid handle BaseException just for cover async task cancellation.
#805
Actually, I noticed by https://github.com/encode/httpcore/pull/802/files#r1326095576. In #802, he tries to handle all of Actually, not only here, also where #726 implemented: |
Replies: 2 comments 12 replies
Can you describe and demonstrate a behaviour that you want to see changed? |
I think the most graceful way to do what you're attempting here would be adding the following in EXCEPTION_OR_CANCELLED= (Exception,)
try:
importtrio# trio support is available to httpcoreEXCEPTION_OR_CANCELLED+= (trio.CancelledError,)
exceptImportError:
passtry:
importanyio# asyncio support is available to httpcoreimportasyncioEXCEPTION_OR_CANCELLED+= (asyncio.Cancelled,)
exceptImportError:
passAnd then import and use EXCEPTION_OR_CANCELLED in the existing try:
...
exceptEXCEPTION_OR_CANCELLEDasexc:
...The would seem to me to be the simplest approach that would work fine for both the |
I think the most graceful way to do what you're attempting here would be adding the following in
_syncronization.py...And then import and use EXCEPTION_OR_CANCELLED in the existing
BaseExceptioncases...The would seem to me to be the simplest approach that would work fine for both the
_…