Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def call_method(method, *args, **kwargs):
try:
if callable(method):
ret = method(*args, **kwargs)
return ret if ret else False
except Exception as err:
logging.error(
"error during executing plugin {}:\n{}".format(
PluginEngine.get_class(method).__name__, str(err) + "\n" +
''.join(traceback.format_tb(err.__traceback__))))
return False