Skip to content

Commit

Permalink
Merge branch 'master' into type_most_of_media
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 authored Aug 30, 2024
2 parents ef236f6 + 3e32ff7 commit 65f11bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
12 changes: 7 additions & 5 deletions falcon/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from enum import auto
from enum import Enum
import http
import sys
from typing import (
Any,
Awaitable,
Expand All @@ -34,13 +35,14 @@
Union,
)

try:
# NOTE(vytas): Mypy still struggles to handle a conditional import in the EAFP
# fashion, so we branch on Py version instead (which it does understand).
if sys.version_info >= (3, 11):
from wsgiref.types import StartResponse as StartResponse
from wsgiref.types import WSGIEnvironment as WSGIEnvironment
except ImportError:
if not TYPE_CHECKING:
WSGIEnvironment = Dict[str, Any]
StartResponse = Callable[[str, List[Tuple[str, str]]], Callable[[bytes], None]]
else:
WSGIEnvironment = Dict[str, Any]
StartResponse = Callable[[str, List[Tuple[str, str]]], Callable[[bytes], None]]

if TYPE_CHECKING:
from falcon.asgi import Request as AsgiRequest
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
module = [
"falcon.asgi.multipart",
"falcon.asgi.response",
"falcon.asgi.stream",
"falcon.media.json",
"falcon.media.msgpack",
"falcon.media.multipart",
"falcon.media.validators.*",
"falcon.responders",
Expand Down
21 changes: 0 additions & 21 deletions tests/bare_bones.py

This file was deleted.

0 comments on commit 65f11bb

Please sign in to comment.