File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -991,8 +991,9 @@ def evolve_function_sig_callback(ctx: mypy.plugin.FunctionSigContext) -> Callabl
991991
992992
993993def _get_cls_from_init (t : Type ) -> Optional [TypeInfo ]:
994- if isinstance (t , CallableType ):
995- return t .type_object ()
994+ proper_type = get_proper_type (t )
995+ if isinstance (proper_type , CallableType ):
996+ return proper_type .type_object ()
996997 return None
997998
998999
@@ -1005,7 +1006,8 @@ def fields_function_callback(ctx: FunctionContext) -> Type:
10051006 if MAGIC_ATTR_NAME in cls .names :
10061007 # This is a proper attrs class.
10071008 ret_type = cls .names [MAGIC_ATTR_NAME ].type
1008- return ret_type
1009+ if ret_type is not None :
1010+ return ret_type
10091011 else :
10101012 ctx .api .fail (
10111013 f'Argument 1 to "fields" has incompatible type "{ format_type_bare (first_arg_type )} "; expected an attrs class' ,
You can’t perform that action at this time.
0 commit comments