Skip to content

Commit 02f642b

Browse files
committed
fix: check types
1 parent b674457 commit 02f642b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

taskiq/middlewares/smart_retry_middleware.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import datetime
44
import random
55
from logging import getLogger
6+
from types import NoneType
67
from typing import Any
78

89
from taskiq import ScheduleSource
@@ -61,10 +62,7 @@ def __init__(
6162
self.max_delay_exponent = max_delay_exponent
6263
self.schedule_source = schedule_source
6364

64-
if schedule_source is not None and not isinstance(
65-
schedule_source,
66-
ScheduleSource,
67-
):
65+
if not isinstance(schedule_source, (ScheduleSource, NoneType)):
6866
raise TypeError(
6967
"schedule_source must be an instance of ScheduleSource or None",
7068
)

0 commit comments

Comments
 (0)