eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityContext.py

changeset 8221
0572a215bd2f
parent 8207
d359172d11be
child 8228
772103b14c18
equal deleted inserted replaced
8220:006ee31b4835 8221:0572a215bd2f
307 argValue = self.getCallArgValue(argumentName) 307 argValue = self.getCallArgValue(argumentName)
308 if argValue is not None: 308 if argValue is not None:
309 if not isinstance(argumentValues, list): 309 if not isinstance(argumentValues, list):
310 # if passed a single value, or a tuple, convert to a list 310 # if passed a single value, or a tuple, convert to a list
311 argumentValues = [argumentValues] 311 argumentValues = [argumentValues]
312 for val in argumentValues: 312 return any(argValue == val for val in argumentValues)
313 if argValue == val:
314 return True
315 return False
316 else: 313 else:
317 # argument name not found, return None to allow testing for this 314 # argument name not found, return None to allow testing for this
318 # eventuality 315 # eventuality
319 return None 316 return None
320 317
400 @param module module name to look for 397 @param module module name to look for
401 @type str 398 @type str
402 @return flag indicating the given module was found 399 @return flag indicating the given module was found
403 @rtype bool 400 @rtype bool
404 """ 401 """
405 if 'imports' in self.__context: 402 try:
406 for imp in self.__context['imports']: 403 return any(module in imp for imp in self.__context['imports'])
407 if module in imp: 404 except KeyError:
408 return True 405 return False
409
410 return False

eric ide

mercurial