File tree 1 file changed +8
-5
lines changed 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,14 @@ def visit_instance(self, left: Instance) -> bool:
135
135
if isinstance (right , TupleType ) and right .fallback .type .is_enum :
136
136
return is_subtype (left , right .fallback )
137
137
if isinstance (right , Instance ):
138
- for base in left .type .mro :
139
- if base ._promote and is_subtype (
140
- base ._promote , self .right , self .check_type_parameter ,
141
- ignore_pos_arg_names = self .ignore_pos_arg_names ):
142
- return True
138
+ # NOTO: left.type.mro may be None in quick mode if there
139
+ # was an error somewhere.
140
+ if left .type .mro is not None :
141
+ for base in left .type .mro :
142
+ if base ._promote and is_subtype (
143
+ base ._promote , self .right , self .check_type_parameter ,
144
+ ignore_pos_arg_names = self .ignore_pos_arg_names ):
145
+ return True
143
146
rname = right .type .fullname ()
144
147
if not left .type .has_base (rname ) and rname != 'builtins.object' :
145
148
return False
You can’t perform that action at this time.
0 commit comments