diff --git a/bugbear.py b/bugbear.py index 5fbfa19..e296f55 100644 --- a/bugbear.py +++ b/bugbear.py @@ -1028,7 +1028,7 @@ def is_classmethod(decorators: Set[str]) -> bool: return bases = {b.id for b in cls.bases if isinstance(b, ast.Name)} - if "type" in bases: + if any(basetype in bases for basetype in ("type", "ABCMeta", "EnumMeta")): if is_classmethod(decorators): expected_first_args = B902.metacls kind = "metaclass class"