File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,19 @@ def get_method_signature_hook(self, fullname: str
1919 ) -> Optional [Callable [[mypy .plugin .MethodSigContext ], mypy .types .CallableType ]]:
2020 class_name , method_name = fullname .rsplit ('.' , 1 )
2121 sym = self .lookup_fully_qualified (class_name )
22- if sym and _is_attribute_type_node (sym .node ):
22+ if sym is not None and sym . node is not None and _is_attribute_type_node (sym .node ):
2323 if method_name == '__get__' :
2424 return _get_method_sig_hook
2525 elif method_name == '__set__' :
2626 return _set_method_sig_hook
2727 return None
2828
2929
30- def _is_attribute_type_node (type_node : mypy .nodes .TypeInfo ) -> bool :
31- return any (base .type .fullname == ATTR_FULL_NAME for base in type_node .bases )
30+ def _is_attribute_type_node (node : mypy .nodes .Node ) -> bool :
31+ return (
32+ isinstance (node , mypy .nodes .TypeInfo ) and
33+ any (base .type .fullname == ATTR_FULL_NAME for base in node .bases )
34+ )
3235
3336
3437def _attribute_marked_as_nullable (t : mypy .types .Instance ) -> mypy .types .Instance :
You can’t perform that action at this time.
0 commit comments