From 21709614679f69352c9fa971e601777b73dc89de Mon Sep 17 00:00:00 2001 From: David Brochart Date: Tue, 2 Jan 2024 11:38:45 +0100 Subject: [PATCH] Fix typing --- jupyverse_api/jupyverse_api/exceptions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jupyverse_api/jupyverse_api/exceptions.py b/jupyverse_api/jupyverse_api/exceptions.py index 81bc916e..7302b40e 100644 --- a/jupyverse_api/jupyverse_api/exceptions.py +++ b/jupyverse_api/jupyverse_api/exceptions.py @@ -1,4 +1,6 @@ -from fastapi import Request, Response +from typing import cast + +from fastapi import Request from fastapi.responses import RedirectResponse @@ -7,5 +9,6 @@ def __init__(self, redirect_to: str): self.redirect_to = redirect_to -async def _redirect_exception_handler(request: Request, exc: RedirectException) -> Response: +async def _redirect_exception_handler(request: Request, exc: Exception) -> RedirectResponse: + exc = cast(RedirectException, exc) return RedirectResponse(url=exc.redirect_to)