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

Handle async cancelled error explicitly #811

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions httpcore/_synchronization.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import threading
from types import TracebackType
from typing import Optional, Tuple, Type
from typing import Optional, Tuple, Type, Union

import sniffio

from ._exceptions import ExceptionMapping, PoolTimeout, map_exceptions

EXCEPTION_OR_CANCELLED: Tuple[Type[BaseException]] = (Exception,)

EXCEPTION_OR_CANCELLED: Union[
Tuple[Type[BaseException]],
Tuple[Type[BaseException], Type[BaseException]],
Tuple[Type[BaseException], Type[BaseException], Type[BaseException]],
] = (Exception,)
T-256 marked this conversation as resolved.
Show resolved Hide resolved

# Our async synchronization primatives use either 'anyio' or 'trio' depending
# on if they're running under asyncio or trio.
Expand Down
Loading