aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/import_tracing/constructor/__init__.py
blob: 47ae8527d49f9486dd5677591f6ded4799724629 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import os


def init():
    if "Y_PYTHON_TRACE_FILE" in os.environ:
        import atexit
        import library.python.import_tracing.lib.regulator as regulator

        regulator.enable(os.getenv("Y_PYTHON_TRACE_FILE"))
        atexit.register(regulator.disable)