Skip to content

Commit 0b7518b

Browse files
committed
Fixed lints.
1 parent 3912213 commit 0b7518b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

taskiq_dependencies/graph.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import inspect
2-
import os
32
import sys
43
import warnings
54
from collections import defaultdict, deque
@@ -177,13 +176,13 @@ def _build_graph(self) -> None: # noqa: C901
177176
try:
178177
hints = get_type_hints(origin.__init__)
179178
except NameError:
180-
_, src_lineno = inspect.getsourcelines(dep.dependency)
181-
src_file = Path(inspect.getfile(dep.dependency)).relative_to(
179+
_, src_lineno = inspect.getsourcelines(origin)
180+
src_file = Path(inspect.getfile(origin)).relative_to(
182181
Path.cwd(),
183182
)
184183
warnings.warn(
185184
"Cannot resolve type hints for "
186-
f"a class {dep.dependency.__name__} defined "
185+
f"a class {origin.__name__} defined "
187186
f"at {src_file}:{src_lineno}.",
188187
RuntimeWarning,
189188
stacklevel=2,
@@ -198,7 +197,7 @@ def _build_graph(self) -> None: # noqa: C901
198197
try:
199198
hints = get_type_hints(dep.dependency)
200199
except NameError:
201-
_, src_lineno = inspect.getsourcelines(dep.dependency)
200+
_, src_lineno = inspect.getsourcelines(dep.dependency) # type: ignore
202201
src_file = Path(inspect.getfile(dep.dependency)).relative_to(
203202
Path.cwd(),
204203
)

tests/test_graph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from collections import UserString
21
import re
32
import uuid
43
from contextlib import asynccontextmanager, contextmanager

0 commit comments

Comments
 (0)