Skip to content

Commit a80900f

Browse files
committed
Placate mypy
Now that we're using importlib, mypy knows that this is a module and thus doesn't like the arbitrary member access.
1 parent 450a219 commit a80900f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

django_lightweight_queue/cron_scheduler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import datetime
44
import importlib
55
import threading
6-
from typing import Any, cast, Dict, List, Tuple, Callable, Optional, Sequence
6+
from typing import Any, Dict, List, Tuple, Callable, Optional, Sequence
77

88
from typing_extensions import TypedDict
99

@@ -144,7 +144,8 @@ def get_matcher(minval, maxval, t):
144144
# No module, move on.
145145
continue
146146

147-
for row in cast(List[CronConfig], mod.CONFIG):
147+
app_cron_config: List[CronConfig] = mod.CONFIG # type: ignore[attr-defined]
148+
for row in app_cron_config:
148149
row['min_matcher'] = get_matcher(0, 59, row.get('minutes'))
149150
row['hour_matcher'] = get_matcher(0, 23, row.get('hours'))
150151
row['day_matcher'] = get_matcher(1, 7, row.get('days', '*'))

0 commit comments

Comments
 (0)