Skip to content

Commit 02eac70

Browse files
committed
Fix selfcheck
1 parent 810504d commit 02eac70

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mypy/plugins/enums.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from typing import Final, TypeVar, cast
1818

1919
import mypy.plugin # To avoid circular imports.
20+
from mypy.checker import TypeChecker
2021
from mypy.nodes import TypeInfo, Var
2122
from mypy.semanal_enum import ENUM_BASES
2223
from mypy.subtypes import is_equivalent
@@ -129,6 +130,7 @@ def _infer_value_type_with_auto_fallback(
129130

130131

131132
def _is_defined_in_stub(ctx: mypy.plugin.AttributeContext) -> bool:
133+
assert isinstance(ctx.api, TypeChecker)
132134
return (
133135
isinstance(ctx.type, Instance)
134136
and ctx.api.modules[ctx.type.type.fullname.rsplit(".", 1)[0]].is_stub

0 commit comments

Comments
 (0)