Skip to content

Commit 58a6623

Browse files
committed
Handle that func.__name__ could be None
1 parent 74fde80 commit 58a6623

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def profile(func: Callable[P, T]) -> Callable[P, T]:
9292
"""
9393

9494
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
95-
profile_filename = func.__name__ + ".prof"
95+
profile_filename = getattr(func, "__name__", "unknown_function") + ".prof"
9696
profiler = cProfile.Profile()
9797
result = profiler.runcall(func, *args, **kwargs)
9898
profiler.dump_stats(profile_filename)

0 commit comments

Comments
 (0)