From db527eb274c6b157040e2cf29bd0edb8705938a0 Mon Sep 17 00:00:00 2001 From: lolyu Date: Wed, 26 Sep 2018 11:00:03 +0800 Subject: [PATCH] debug: python3 fix for _log_calls _log_calls uses func_code and func_name, which are not supported in python3. Signed-off-by: lolyu --- avocado/utils/debug.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/avocado/utils/debug.py b/avocado/utils/debug.py index 7976018b..647fb404 100644 --- a/avocado/utils/debug.py +++ b/avocado/utils/debug.py @@ -20,6 +20,7 @@ import time import os from six import iteritems +from six import get_function_code # Use this for debug logging @@ -69,8 +70,8 @@ def _log_calls(func, length=None, cls_name=None): def wrapper(*args, **kwargs): """ Wrapper function """ msg = ("CALL: %s:%s%s(%s, %s)" - % (os.path.relpath(func.func_code.co_filename), - cls_name, func.func_name, + % (os.path.relpath(get_function_code(func).co_filename), + cls_name, func.__name__, ", ".join([str(_) for _ in args]), ", ".join(["%s=%s" % (key, value) for key, value in iteritems(kwargs)]))) -- GitLab