Refactor code to remove alerts as per lgtm and #1176.

This commit is contained in:
Griatch 2017-01-29 19:02:00 +01:00
parent dcde526f6d
commit 74eebfed6d
54 changed files with 226 additions and 264 deletions

View file

@ -182,7 +182,6 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
#instantiate the cmdset (and catch its errors)
if callable(cmdsetclass):
cmdsetclass = cmdsetclass(cmdsetobj)
errstring = ""
return cmdsetclass
except ImportError as err:
logger.log_trace()
@ -213,6 +212,7 @@ def import_cmdset(path, cmdsetobj, emit_to_obj=None, no_logging=False):
else:
errstring = errstring.format(path=python_path, traceback=err, timestamp=logger.timeformat())
break
return None # an error
if errstring:
# returning an empty error cmdset