Skip to content

Commit 9c8e70d

Browse files
committed
Add asyncio Protocol types to class Config kwargs
Protocol classes are sometimes used for the app kwarg, such as in tests/test_config.py.
1 parent d31fddd commit 9c8e70d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

uvicorn/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import ssl
99
import sys
1010
from pathlib import Path
11-
from typing import Awaitable, Callable, Dict, List, Optional, Tuple, Union
11+
from typing import Awaitable, Callable, Dict, List, Optional, Tuple, Type, Union
1212

1313
if sys.version_info < (3, 8):
1414
from typing_extensions import Literal
@@ -137,8 +137,8 @@ def __init__(
137137
uds: Optional[str] = None,
138138
fd: Optional[int] = None,
139139
loop: str = "auto",
140-
http: str = "auto",
141-
ws: str = "auto",
140+
http: Union[Type[asyncio.Protocol], str] = "auto",
141+
ws: Union[Type[asyncio.Protocol], str] = "auto",
142142
ws_max_size: int = 16 * 1024 * 1024,
143143
lifespan: str = "auto",
144144
env_file: Optional[Union[Path, str]] = None,

0 commit comments

Comments
 (0)