Skip to content
Myr

Fix conditional imports for pyright (#1839)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Robert Craigie · committed by GitHub · parent 513a6aa · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:httpx/_compat.py+2 added-2 removed
5 unmodified lines
6import sys78# `contextlib.asynccontextmanager` exists from Python 3.7 onwards.9# For 3.6 we require the `async_generator` package for a backported version.10try:10if sys.version_info >= (3, 7):11 from contextlib import asynccontextmanager # type: ignore12except ImportError:12else:13 from async_generator import asynccontextmanager # type: ignore # noqa1415# Brotli support is optional16# The C bindings in `brotli` are recommended for CPython.
32 unmodified lines