sugarsdk/linting/pep287.py
def what_raises(self, node, raises=None):
        """
        Return number of raises statements in the code.

        :param node: function node
        :param raises: Reserved for the internal data transfer
        :return: List of explicitly raised exception class names
        """
        if raises is None:
            raises = []

        for element in node.get_children():
            if isinstance(element, astroid.node_classes.Raise):
                if isinstance(element.exc, astroid.node_classes.Name):
                    raises.append('-') # skipper
                elif element.exc is None and element.cause is None:
                    raises.append("-")
                elif hasattr(element.exc.func, "name"):
                    raises.append(element.exc.func.name)
                elif hasattr(element.exc.func, "attrname"):
                    raises.append(element.exc.func.attrname)
                else:
                    raises.append("undetected exception")
            else:
                raises = self.what_raises(element, raises=raises)

        return raises

        Return number of raises statements in the code.

        :param node: function node
        :param raises: Reserved for the internal data transfer
        :return: List of explicitly raised exception class names
        
Return number of raises statements in the code.
Return number of raises statements in the code .
def what_raises(self, node, raises=None):
        if raises is None:
            raises = []
        for element in node.get_children():
            if isinstance(element, astroid.node_classes.Raise):
                if isinstance(element.exc, astroid.node_classes.Name):
                    raises.append('-') 
                elif element.exc is None and element.cause is None:
                    raises.append("-")
                elif hasattr(element.exc.func, "name"):
                    raises.append(element.exc.func.name)
                elif hasattr(element.exc.func, "attrname"):
                    raises.append(element.exc.func.attrname)
                else:
                    raises.append("undetected exception")
            else:
                raises = self.what_raises(element, raises=raises)
        return raises
def what_raises ( self , node , raises = None ) : if raises is None : raises = [ ] for element in node . get_children ( ) : if isinstance ( element , astroid . node_classes . Raise ) : if isinstance ( element . exc , astroid . node_classes . Name ) : raises . append ( '-' ) elif element . exc is None and element . cause is None : raises . append ( "-" ) elif hasattr ( element . exc . func , "name" ) : raises . append ( element . exc . func . name ) elif hasattr ( element . exc . func , "attrname" ) : raises . append ( element . exc . func . attrname ) else : raises . append ( "undetected exception" ) else : raises = self . what_raises ( element , raises = raises ) return raises
Return number of raises statements in the code.
Return number of raises statements in the code .
"""
        Return number of raises statements in the code.

        :param node: function node
        :param raises: Reserved for the internal data transfer
        :return: List of explicitly raised exception class names
        """ # skipper
List of explicitly raised exception class names
List of explicitly raised exception class names
self
node
None
raises
Reserved for the internal data transfer
Reserved for the internal data transfer