mirror of https://github.com/craigerl/aprsd.git
Fixed tox pep8 failure for trace
This commit is contained in:
parent
af48c43eb2
commit
0b44fc08eb
|
@ -138,18 +138,18 @@ class TraceWrapperMetaclass(type):
|
||||||
class MyClass(object, metaclass=utils.TraceWrapperMetaclass):
|
class MyClass(object, metaclass=utils.TraceWrapperMetaclass):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __new__(meta, classname, bases, classDict):
|
def __new__(cls, classname, bases, class_dict):
|
||||||
newClassDict = {}
|
new_class_dict = {}
|
||||||
for attributeName, attribute in classDict.items():
|
for attribute_name, attribute in class_dict.items():
|
||||||
if isinstance(attribute, types.FunctionType):
|
if isinstance(attribute, types.FunctionType):
|
||||||
# replace it with a wrapped version
|
# replace it with a wrapped version
|
||||||
attribute = functools.update_wrapper(
|
attribute = functools.update_wrapper(
|
||||||
trace_method(attribute),
|
trace_method(attribute),
|
||||||
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):
|
class TraceWrapperWithABCMetaclass(abc.ABCMeta, TraceWrapperMetaclass):
|
||||||
|
|
Loading…
Reference in New Issue