From 9920d53927bbee22b8121b49e51196e555f7018a Mon Sep 17 00:00:00 2001 From: naglis <827324+naglis@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:42:07 +0200 Subject: [PATCH] Add `@functools.wraps` on `timing` decorator Without it, the name/docstring of the wrapped function is lost. --- cozy/architecture/profiler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cozy/architecture/profiler.py b/cozy/architecture/profiler.py index d5a84e8b..fd95093b 100644 --- a/cozy/architecture/profiler.py +++ b/cozy/architecture/profiler.py @@ -1,9 +1,11 @@ import time import logging +import functools log = logging.getLogger("timing") def timing(f): + @functools.wraps(f) def wrap(*args): time1 = time.time() ret = f(*args)