File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 11import inspect
2- import os
32import sys
43import warnings
54from 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 )
Original file line number Diff line number Diff line change 1- from collections import UserString
21import re
32import uuid
43from contextlib import asynccontextmanager , contextmanager
You can’t perform that action at this time.
0 commit comments