Skip to content

Commit 48064ab

Browse files
author
Jeff Weiss
committed
Fixes
1 parent 449ad16 commit 48064ab

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

function_trace/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
'''
3030

3131
from contextlib import contextmanager, closing
32-
from functools import wraps
3332
from inspect import isclass, ismethod, getmembers
3433
import threading
3534
import os
@@ -138,11 +137,17 @@ def close(self):
138137
thread_locals.outputfile.close()
139138

140139

140+
def _copy_attrs(old, new):
141+
for a in ('__name__', '__doc__', '__module__'):
142+
if hasattr(old, a):
143+
setattr(new, a, getattr(old, a))
144+
145+
141146
def add_trace(f, tracer, depth=None):
142-
@wraps(f)
143147
def traced_fn(*args, **kwargs):
144148
return tracer.trace(f, args, kwargs, additional_depth=depth)
145149
traced_fn.trace = True # set flag so that we don't add trace more than once
150+
#_copy_attrs(f, traced_fn)
146151
return traced_fn
147152

148153

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22
setup(
33
name="function_trace",
4-
version="1.0.3",
4+
version="1.0.5",
55
packages=find_packages(),
66

77
# metadata for upload to PyPI

0 commit comments

Comments
 (0)