diff --git a/mypy/subtypes.py b/mypy/subtypes.py index d122923155bf..a280c217cd8a 100644 --- a/mypy/subtypes.py +++ b/mypy/subtypes.py @@ -135,11 +135,14 @@ def visit_instance(self, left: Instance) -> bool: if isinstance(right, TupleType) and right.fallback.type.is_enum: return is_subtype(left, right.fallback) if isinstance(right, Instance): - for base in left.type.mro: - if base._promote and is_subtype( - base._promote, self.right, self.check_type_parameter, - ignore_pos_arg_names=self.ignore_pos_arg_names): - return True + # NOTO: left.type.mro may be None in quick mode if there + # was an error somewhere. + if left.type.mro is not None: + for base in left.type.mro: + if base._promote and is_subtype( + base._promote, self.right, self.check_type_parameter, + ignore_pos_arg_names=self.ignore_pos_arg_names): + return True rname = right.type.fullname() if not left.type.has_base(rname) and rname != 'builtins.object': return False