Do not use len() in log_exec decorator

It is not necessary to use the len method here.

Change-Id: If938d130250327d5b10eb3303d2a2fa3b928c414
This commit is contained in:
Christian Berendt 2015-11-10 17:16:58 +01:00
parent 15a5ad3929
commit fadc8e39e7

View File

@ -101,7 +101,7 @@ def log_exec(logger, level=logging.DEBUG):
def _decorator(func): def _decorator(func):
def _logged(*args, **kw): def _logged(*args, **kw):
params_repr = ("[args=%s, kw=%s]" % (str(args), str(kw)) params_repr = ("[args=%s, kw=%s]" % (str(args), str(kw))
if len(args) > 0 or len(kw) > 0 else "") if args or kw else "")
func_repr = ("Called method [name=%s, doc='%s', params=%s]" % func_repr = ("Called method [name=%s, doc='%s', params=%s]" %
(func.__name__, func.__doc__, params_repr)) (func.__name__, func.__doc__, params_repr))