Skip to content
Discussion options

You must be logged in to vote

I think the most graceful way to do what you're attempting here would be adding the following in _syncronization.py...

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:
pass

And then import and use EXCEPTION_OR_CANCELLED in the existing BaseException cases...

try:
...
exceptEXCEPTION_OR_CANCELLEDasexc:
...

The would seem to me to be the simplest approach that would work fine for both the _…

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
11 replies
@T-256
Comment options

@karpetrosyan
Comment options

@T-256
Comment options

@lovelydinosaur
Comment options

@T-256
Comment options

Comment options

You must be logged in to vote
1 reply
@T-256
Comment options

Answer selected byT-256
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
@T-256@lovelydinosaur@zanieb@karpetrosyan