src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityUtils.py

branch
eric7
changeset 9272
06ed98a19b79
parent 9221
bf71ee032bb4
child 9462
e65379fdbd97
equal deleted inserted replaced
9271:f655c20ff500 9272:06ed98a19b79
12 import contextlib 12 import contextlib
13 13
14 import AstUtilities 14 import AstUtilities
15 15
16 16
17 class InvalidModulePath(Exception): 17 class InvalidModulePathError(Exception):
18 """ 18 """
19 Class defining an exception for invalid module paths. 19 Class defining an exception for invalid module paths.
20 """ 20 """
21 21
22 pass 22 pass
38 38
39 @param path path of the module to be analyzed 39 @param path path of the module to be analyzed
40 @type str 40 @type str
41 @return qualified name of the module 41 @return qualified name of the module
42 @rtype str 42 @rtype str
43 @exception InvalidModulePath raised to indicate an invalid module path 43 @exception InvalidModulePathError raised to indicate an invalid module path
44 """ 44 """
45 (head, tail) = os.path.split(path) 45 (head, tail) = os.path.split(path)
46 if head == "" or tail == "": 46 if head == "" or tail == "":
47 raise InvalidModulePath( 47 raise InvalidModulePathError(
48 'Invalid python file path: "{0}"' " Missing path or file name".format(path) 48 'Invalid python file path: "{0}"' " Missing path or file name".format(path)
49 ) 49 )
50 50
51 qname = [os.path.splitext(tail)[0]] 51 qname = [os.path.splitext(tail)[0]]
52 while head not in ["/", ".", ""]: 52 while head not in ["/", ".", ""]:

eric ide

mercurial