Skip to content

Commit

Permalink
fix(helpers.timeout): BatchTimeout: too strict type annotation on cb
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Jun 26, 2024
1 parent cb94d6c commit 1de5f5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/helpers/timeout/_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations
from typing import Callable, Optional, Awaitable, Generic, TypeVar, Any
from typing import Callable, Optional, Awaitable, Generic, TypeVar, Any, Union
from typing_extensions import ParamSpec

import asyncio
Expand All @@ -20,10 +20,10 @@ def __init__(
timeout: float,
loop: asyncio.AbstractEventLoop = None,
on_success: Callable[[R, P], None] = noop,
on_canceled: Callable[[BaseException, P], None] = noop,
on_error: Callable[[BaseException, P], None] = noop,
on_timeout: Callable[[BaseException, P], None] = noop,
on_timeout_error: Callable[[BaseException, P], None] = noop,
on_canceled: Callable[[asyncio.CancelledError, P], None] = noop,
on_error: Callable[[Exception, P], None] = noop,
on_timeout: Callable[[asyncio.CancelledError, P], None] = noop,
on_timeout_error: Callable[[Union[asyncio.CancelledError, Exception], P], None] = noop,
):
"""
A context manager aims to solve these issues:
Expand Down

0 comments on commit 1de5f5b

Please sign in to comment.