Wed, 27 Jul 2022 15:51:27 +0200
Changed some exception names to comply with PEP-8.
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Imports/ImportNode.py Wed Jul 27 15:01:13 2022 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Imports/ImportNode.py Wed Jul 27 15:51:27 2022 +0200 @@ -17,7 +17,7 @@ from .ImportsEnums import GroupEnum, NodeTypeEnum -class ImportNodeException(Exception): +class ImportNodeError(Exception): """ Class representing an exception for an invalid import node. """ @@ -41,11 +41,11 @@ @type ast.AST @param checker reference to the checker object @type ImportsChecker - @exception ImportNodeException raised to indicate an invalid node was + @exception ImportNodeError raised to indicate an invalid node was given to this class """ if not isinstance(astNode, (ast.Import, ast.ImportFrom)): - raise ImportNodeException( + raise ImportNodeError( "Node type {0} not recognized".format(type(astNode)) ) @@ -123,11 +123,11 @@ @return string representation of the instance @rtype str - @exception ImportNodeException raised to indicate an invalid node was + @exception ImportNodeError raised to indicate an invalid node was given to this class """ if self.nodeType not in (NodeTypeEnum.IMPORT, NodeTypeEnum.IMPORT_FROM): - raise ImportNodeException( + raise ImportNodeError( "The node type {0} is not recognized.".format(self.nodeType) )
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityNodeVisitor.py Wed Jul 27 15:01:13 2022 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityNodeVisitor.py Wed Jul 27 15:51:27 2022 +0200 @@ -41,7 +41,7 @@ # in some cases we can't determine a qualified name try: self.namespace = SecurityUtils.getModuleQualnameFromPath(filename) - except SecurityUtils.InvalidModulePath: + except SecurityUtils.InvalidModulePathError: self.namespace = "" def __runChecks(self, checkType):
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityUtils.py Wed Jul 27 15:01:13 2022 +0200 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityUtils.py Wed Jul 27 15:51:27 2022 +0200 @@ -14,7 +14,7 @@ import AstUtilities -class InvalidModulePath(Exception): +class InvalidModulePathError(Exception): """ Class defining an exception for invalid module paths. """ @@ -40,11 +40,11 @@ @type str @return qualified name of the module @rtype str - @exception InvalidModulePath raised to indicate an invalid module path + @exception InvalidModulePathError raised to indicate an invalid module path """ (head, tail) = os.path.split(path) if head == "" or tail == "": - raise InvalidModulePath( + raise InvalidModulePathError( 'Invalid python file path: "{0}"' " Missing path or file name".format(path) )