8000 fix self-check · python/mypy@e9f876e · GitHub
[go: up one dir, main page]

Skip to content

Commit e9f876e

Browse files
committed
fix self-check
1 parent cbd71ee commit e9f876e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mypy/plugins/attrs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,9 +965,10 @@ def evolve_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
965965
inst_type = get_proper_type(inst_type)
966966
if isinstance(inst_type, AnyType):
967967
return ctx.default_signature # evolve(Any, ....) -> Any
968-
# We stringify it first, so that TypeVars maintain their name.
969968
inst_type_str = format_type_bare(inst_type)
970-
attrs_type = inst_type.upper_bound if isinstance(inst_type, TypeVarType) else inst_type
969+
attrs_type = get_proper_type(
970+
inst_type.upper_bound if isinstance(inst_type, TypeVarType) else inst_type
971+
)
971972
attrs_init_type = None
972973
if isinstance(attrs_type, Instance):
973974
attrs_init_type = _get_attrs_init_type(attrs_type)
@@ -979,6 +980,7 @@ def evolve_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
979980
ctx.context,
980981
)
981982
return ctx.default_signature
983+
assert isinstance(attrs_type, Instance)
982984

983985
attrs_init_type = expand_type_by_instance(attrs_init_type, attrs_type)
984986

0 commit comments

Comments
 (0)
0