Эх сурвалжийг харах

Fix and enable super-init-not-called lint

Nathaniel Manista 8 жил өмнө
parent
commit
18f025e0a3

+ 1 - 2
.pylintrc

@@ -34,6 +34,5 @@ notes=FIXME,XXX
 #TODO: Enable useless-else-on-loop
 #TODO: Enable useless-else-on-loop
 #TODO: Enable too-many-return-statements
 #TODO: Enable too-many-return-statements
 #TODO: Enable too-many-nested-blocks
 #TODO: Enable too-many-nested-blocks
-#TODO: Enable super-init-not-called
 
 
-disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called
+disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks

+ 12 - 11
src/python/grpcio/grpc/framework/interfaces/base/base.py

@@ -50,22 +50,23 @@ from grpc.framework.foundation import abandonment  # pylint: disable=unused-impo
 class NoSuchMethodError(Exception):
 class NoSuchMethodError(Exception):
     """Indicates that an unrecognized operation has been called.
     """Indicates that an unrecognized operation has been called.
 
 
-  Attributes:
-    code: A code value to communicate to the other side of the operation along
-      with indication of operation termination. May be None.
-    details: A details value to communicate to the other side of the operation
-      along with indication of operation termination. May be None.
-  """
-
-    def __init__(self, code, details):
-        """Constructor.
-
-    Args:
+    Attributes:
       code: A code value to communicate to the other side of the operation
       code: A code value to communicate to the other side of the operation
         along with indication of operation termination. May be None.
         along with indication of operation termination. May be None.
       details: A details value to communicate to the other side of the
       details: A details value to communicate to the other side of the
         operation along with indication of operation termination. May be None.
         operation along with indication of operation termination. May be None.
     """
     """
+
+    def __init__(self, code, details):
+        """Constructor.
+
+        Args:
+          code: A code value to communicate to the other side of the operation
+            along with indication of operation termination. May be None.
+          details: A details value to communicate to the other side of the
+            operation along with indication of operation termination. May be None.
+        """
+        super(NoSuchMethodError, self).__init__()
         self.code = code
         self.code = code
         self.details = details
         self.details = details