|
6 | 6 | from contextlib import AsyncExitStack, asynccontextmanager |
7 | 7 | from inspect import signature |
8 | 8 | from pathlib import Path |
9 | | -from typing import Any, Callable, Optional, TypeVar, cast |
| 9 | +from typing import Any, Callable, Mapping, Optional, TypeVar, cast |
10 | 10 |
|
11 | 11 | import starlette.applications |
12 | 12 | import starlette.exceptions |
@@ -113,7 +113,7 @@ def __init__( |
113 | 113 | Callable[[Inputs], None] | Callable[[Inputs, Outputs, Session], None] | None |
114 | 114 | ), |
115 | 115 | *, |
116 | | - static_assets: Optional[str | Path | dict[str, str | Path]] = None, |
| 116 | + static_assets: Optional[str | Path | Mapping[str, str | Path]] = None, |
117 | 117 | debug: bool = False, |
118 | 118 | ) -> None: |
119 | 119 | # Used to store callbacks to be called when the app is shutting down (according |
@@ -143,7 +143,7 @@ def __init__( |
143 | 143 | if static_assets is None: |
144 | 144 | static_assets = {} |
145 | 145 |
|
146 | | - if isinstance(static_assets, dict): |
| 146 | + if isinstance(static_assets, Mapping): |
147 | 147 | static_assets_map = {k: Path(v) for k, v in static_assets.items()} |
148 | 148 | else: |
149 | 149 | static_assets_map = {"/": Path(static_assets)} |
|
0 commit comments