Skip to content

Commit 68aef10

Browse files
committed
still trynig to fix mypy
1 parent b85b289 commit 68aef10

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/paste/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818
from starlette.requests import Request
1919
from starlette.responses import Response
20-
from typing import Callable, Awaitable, List, Optional
20+
from typing import Callable, Awaitable, List, Optional, Union, Any
2121
import shutil
2222
import os
2323
import json
@@ -54,8 +54,8 @@
5454
)
5555
app.state.limiter = limiter
5656

57-
async def rate_limit_exceeded_handler(request: Request, exc: RateLimitExceeded) -> Response:
58-
return await _rate_limit_exceeded_handler(request, exc)
57+
async def rate_limit_exceeded_handler(request: Request, exc: Exception) -> Union[Response, Awaitable[Response]]:
58+
return _rate_limit_exceeded_handler(request, exc)
5959

6060
app.add_exception_handler(RateLimitExceeded, rate_limit_exceeded_handler)
6161

0 commit comments

Comments
 (0)