Skip to content

Commit e517a1f

Browse files
authored
Use PRI_MYPY in get_additional_deps hook (#2024)
This value comes from here: https://github.com/python/mypy/blob/394d17b758bae6c95cbe91b84c5cccf0f4d73c28/mypy/build.py#L382 It is more correct than `PRI_MED` that we used, because it is a typing-only import.
1 parent 673c832 commit e517a1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy_django_plugin/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from functools import partial
44
from typing import Any, Callable, Dict, List, Optional, Tuple, Type
55

6+
from mypy.build import PRI_MYPY
67
from mypy.modulefinder import mypy_path
78
from mypy.nodes import MypyFile, TypeInfo
89
from mypy.options import Options
@@ -99,7 +100,8 @@ def _get_typeinfo_or_none(self, class_name: str) -> Optional[TypeInfo]:
99100
return None
100101

101102
def _new_dependency(self, module: str) -> Tuple[int, str, int]:
102-
return 10, module, -1
103+
fake_lineno = -1
104+
return (PRI_MYPY, module, fake_lineno)
103105

104106
def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]:
105107
# for settings

0 commit comments

Comments
 (0)