File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
astroid/nodes/scoped_nodes Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1775,7 +1775,7 @@ def _class_type(
1775
1775
klass : ClassDef ,
1776
1776
ancestors : set [str ] | None = None ,
1777
1777
context : InferenceContext | None = None ,
1778
- ):
1778
+ ) -> Literal [ "class" , "exception" , "metaclass" ] :
1779
1779
"""return a ClassDef node type to differ metaclass and exception
1780
1780
from 'regular' classes
1781
1781
"""
@@ -1798,7 +1798,7 @@ def _class_type(
1798
1798
for base in klass .ancestors (recurs = False ):
1799
1799
name = _class_type (base , ancestors )
1800
1800
if name != "class" :
1801
- if name == "metaclass" and not _is_metaclass ( klass ) :
1801
+ if name == "metaclass" and klass . _type != "metaclass" :
1802
1802
# don't propagate it if the current class
1803
1803
# can't be a metaclass
1804
1804
continue
You can’t perform that action at this time.
0 commit comments