From 131099750ec9bfe81255903ee2b1cca714499004 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Mon, 7 Sep 2020 14:50:36 +0545 Subject: [PATCH] Disable cprofile on exit of the contextmanager `profile` (#4542) Does not change anything, it's good to disable it just after yield to not show other stats by accident. --- dvc/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dvc/main.py b/dvc/main.py index 5a1846d76..b74488afb 100644 --- a/dvc/main.py +++ b/dvc/main.py @@ -35,6 +35,7 @@ def profile(enable, dump): yield + prof.disable() if not dump: prof.print_stats(sort="cumtime") return