1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-19 16:15:57 -05:00

Fixed tox pep8 failure for trace

This commit is contained in:
Hemna 2021-01-29 10:15:20 -05:00
parent af48c43eb2
commit 0b44fc08eb

View File

@ -138,18 +138,18 @@ class TraceWrapperMetaclass(type):
class MyClass(object, metaclass=utils.TraceWrapperMetaclass):
"""
def __new__(meta, classname, bases, classDict):
newClassDict = {}
for attributeName, attribute in classDict.items():
def __new__(cls, classname, bases, class_dict):
new_class_dict = {}
for attribute_name, attribute in class_dict.items():
if isinstance(attribute, types.FunctionType):
# replace it with a wrapped version
attribute = functools.update_wrapper(
trace_method(attribute),
attribute,
)
newClassDict[attributeName] = attribute
new_class_dict[attribute_name] = attribute
return type.__new__(meta, classname, bases, newClassDict)
return type.__new__(cls, classname, bases, new_class_dict)
class TraceWrapperWithABCMetaclass(abc.ABCMeta, TraceWrapperMetaclass):