File: decorators.py

package info (click to toggle)
pycallgraph 1.1.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 416 kB
  • sloc: python: 1,925; makefile: 47
file content (15 lines) | stat: -rw-r--r-- 324 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import functools

from .pycallgraph import PyCallGraph


def trace(output=None, config=None):
    def inner(func):
        @functools.wraps(func)
        def exec_func(*args, **kw_args):
            with(PyCallGraph(output, config)):
                return func(*args, **kw_args)

        return exec_func

    return inner