Skip to content

Commit f1aa19c

Browse files
py3.9 needs union for cast
1 parent 7162f5d commit f1aa19c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shiny/_app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from contextlib import AsyncExitStack, asynccontextmanager
77
from inspect import signature
88
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
1010

1111
import starlette.applications
1212
import starlette.exceptions
@@ -126,12 +126,12 @@ def __init__(
126126
self.server = wrap_async(noop_server_fn)
127127
elif len(signature(server).parameters) == 1:
128128
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))
130130
)
131131
elif len(signature(server).parameters) == 3:
132132
self.server = wrap_async(
133133
cast(
134-
Callable[[Inputs, Outputs, Session], Awaitable[None] | None], server
134+
Callable[[Inputs, Outputs, Session], Union[Awaitable[None], None]], server
135135
)
136136
)
137137
else:

0 commit comments

Comments
 (0)