summaryrefslogtreecommitdiff
path: root/checkers/newstyle.py
diff options
context:
space:
mode:
Diffstat (limited to 'checkers/newstyle.py')
-rw-r--r--checkers/newstyle.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/checkers/newstyle.py b/checkers/newstyle.py
index 532f3f1..cf50229 100644
--- a/checkers/newstyle.py
+++ b/checkers/newstyle.py
@@ -79,9 +79,10 @@ class NewStyleConflictChecker(BaseChecker):
"""
if '__slots__' in node and not node.newstyle:
self.add_message('slots-on-old-class', node=node)
- # If the class node is not marked as newstyle and it has no explicitly
- # defined metaclass, then it's an old style class.
- if not node.newstyle and node.type == 'class' and not node.metaclass():
+ # The node type could be class, exception, metaclass, or
+ # interface. Presumably, the non-class-type nodes would always
+ # have an explicit base class anyway.
+ if not node.bases and node.type == 'class' and not node.metaclass():
self.add_message('old-style-class', node=node)
@check_messages('property-on-old-class')