pylint-w0231.patch

download
diff --git a/checkers/classes.py b/checkers/classes.py
--- a/checkers/classes.py
+++ b/checkers/classes.py
@@ -537,8 +537,8 @@ a class method.'}
                         self.add_message('W0233', node=expr, args=klass.name)
             except astng.InferenceError:
                 continue
-        for klass in not_called_yet.keys():
-            if klass.name == 'object':
+        for klass, method in not_called_yet.items():
+            if klass.name == 'object' or method.parent.name == 'object':
                 continue
             self.add_message('W0231', args=klass.name, node=node)
 
@@ -578,8 +578,7 @@ def _ancestors_to_call(klass_node, metho
     to_call = {}
     for base_node in klass_node.ancestors(recurs=False):
         try:
-            base_node.local_attr(method)
-            to_call[base_node] = 1
+            to_call[base_node] = base_node.local_attr(method)[-1]
         except astng.NotFoundError:
             continue
     return to_call
diff --git a/test/input/func_w0231.py b/test/input/func_w0231.py
--- a/test/input/func_w0231.py
+++ b/test/input/func_w0231.py
@@ -36,3 +36,13 @@ class NewStyleB(NewStyleA):
     """derived new style class"""
     def __init__(self):
         super(NewStyleB, self).__init__()
+
+
+class NoInit(object):
+    """No __init__ defined"""
+
+class Init(NoInit):
+    """Don't complain for not calling the super __init__"""
+
+    def __init__(self, arg):
+        self.arg = arg