|
6 | 6 | from contextlib import AsyncExitStack, asynccontextmanager |
7 | 7 | from inspect import signature |
8 | 8 | from pathlib import Path |
9 | | -from typing import Any, Awaitable, Callable, Mapping, Optional, TypeVar, cast |
| 9 | +from typing import Any, Awaitable, Callable, Mapping, Optional, TypeVar, Union, cast |
10 | 10 |
|
11 | 11 | import starlette.applications |
12 | 12 | import starlette.exceptions |
@@ -126,12 +126,12 @@ def __init__( |
126 | 126 | self.server = wrap_async(noop_server_fn) |
127 | 127 | elif len(signature(server).parameters) == 1: |
128 | 128 | self.server = wrap_server_fn_with_output_session( |
129 | | - wrap_async(cast(Callable[[Inputs], Awaitable[None] | None], server)) |
| 129 | + wrap_async(cast(Callable[[Inputs], Union[Awaitable[None], None]], server)) |
130 | 130 | ) |
131 | 131 | elif len(signature(server).parameters) == 3: |
132 | 132 | self.server = wrap_async( |
133 | 133 | cast( |
134 | | - Callable[[Inputs, Outputs, Session], Awaitable[None] | None], server |
| 134 | + Callable[[Inputs, Outputs, Session], Union[Awaitable[None], None]], server |
135 | 135 | ) |
136 | 136 | ) |
137 | 137 | else: |
|
0 commit comments