lint fixes

This commit is contained in:
Илья Глазунов
2025-12-04 01:27:43 +03:00
parent 3454801be7
commit edaccb59bb
3 changed files with 10 additions and 6 deletions
+7 -4
View File
@@ -11,7 +11,9 @@ The WSGI app path is passed via environment variables:
import importlib
import os
from typing import Any, Callable
from typing import Any, Callable, Optional
WSGI_ADAPTER: Optional[str] = None
try:
from a2wsgi import WSGIMiddleware
@@ -27,7 +29,7 @@ except ImportError:
WSGI_ADAPTER = None
def _load_wsgi_app() -> Callable:
def _load_wsgi_app() -> Callable[..., Any]:
app_path = os.environ.get("PYSERVE_WSGI_APP")
is_factory = os.environ.get("PYSERVE_WSGI_FACTORY", "0") == "1"
@@ -51,8 +53,9 @@ def _load_wsgi_app() -> Callable:
raise RuntimeError(f"Module '{module_name}' has no attribute '{attr_name}'")
if is_factory:
return app_or_factory()
return app_or_factory
result: Callable[..., Any] = app_or_factory()
return result
return app_or_factory # type: ignore[return-value]
def _create_asgi_app() -> Any: