eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/blackListImports.py

changeset 8222
5994b80b8760
parent 7923
91e843545d9a
equal deleted inserted replaced
8221:0572a215bd2f 8222:5994b80b8760
105 """ 105 """
106 nodeType = context.node.__class__.__name__ 106 nodeType = context.node.__class__.__name__
107 107
108 if nodeType.startswith('Import'): 108 if nodeType.startswith('Import'):
109 prefix = "" 109 prefix = ""
110 if nodeType == "ImportFrom": 110 if (
111 if context.node.module is not None: 111 nodeType == "ImportFrom" and
112 prefix = context.node.module + "." 112 context.node.module is not None
113 ):
114 prefix = context.node.module + "."
113 115
114 for code in _blacklists: 116 for code in _blacklists:
115 qualnames, severity = _blacklists[code] 117 qualnames, severity = _blacklists[code]
116 for name in context.node.names: 118 for name in context.node.names:
117 for qualname in qualnames: 119 for qualname in qualnames:

eric ide

mercurial