py3: Replace func.func_name with func.__name__

The func_name attribute has been removed in Python 3. Functions have the
__name__ attribute on Python 2 and Python 3.

Partial-Implements: blueprint porting-python3
Change-Id: I79bb5f06b0323767c51d0378eb52c6c96a61ffc9
This commit is contained in:
Victor Stinner 2015-08-19 17:21:14 -07:00
parent be746bca4e
commit e8e7aad6cc
2 changed files with 3 additions and 3 deletions

View File

@ -395,7 +395,7 @@ class Column(html.HTMLElement):
except Exception:
msg = ("Filter '%(filter)s' failed with data "
"'%(data)s' on column '%(col_name)s'")
args = {'filter': filter_func.func_name,
args = {'filter': filter_func.__name__,
'data': data,
'col_name': six.text_type(self.verbose_name)}
LOG.warning(msg, args)

View File

@ -91,7 +91,7 @@ def services_required(*req_services):
raise ValueError(NOT_TEST_OBJECT_ERROR_MSG)
skip_method = _mark_class_skipped
else:
if not _is_test_method_name(obj.func_name):
if not _is_test_method_name(obj.__name__):
raise ValueError(NOT_TEST_OBJECT_ERROR_MSG)
skip_method = _mark_method_skipped
# get available services from configuration
@ -125,7 +125,7 @@ def skip_because(**kwargs):
raise ValueError(NOT_TEST_OBJECT_ERROR_MSG)
skip_method = _mark_class_skipped
else:
if not _is_test_method_name(obj.func_name):
if not _is_test_method_name(obj.__name__):
raise ValueError(NOT_TEST_OBJECT_ERROR_MSG)
skip_method = _mark_method_skipped
bugs = kwargs.get("bugs")