From 5c790ae1f28cceeff5e0b9196c47f43e112d8135 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 21 Sep 2020 10:24:24 -0600 Subject: Use cProfile if profiling. Signed-off-by: Mats Wichmann --- CHANGES.txt | 3 +++ SCons/Script/Main.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index fc1d857..2a20ed1 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -46,6 +46,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - merging --param arguments did not work (issue #3107); - passing a dict to merge where the values are strings failed (issue #2961). - Include previously-excluded SideEffect section in User Guide. + - Make sure cProfile is used if profiling - SCons was expecting + the Util module to monkeypatch in cProfile as profile if available, + but this is no longer being done. From Joachim Kuebart: - Suppress missing SConscript deprecation warning if `must_exist=False` diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py index 66222ae..b0bcac7 100644 --- a/SCons/Script/Main.py +++ b/SCons/Script/Main.py @@ -1343,8 +1343,7 @@ def _exec_main(parser, values): import pdb pdb.Pdb().runcall(_main, parser) elif options.profile_file: - # compat layer imports "cProfile" for us if it's available. - from profile import Profile + from cProfile import Profile prof = Profile() try: -- cgit v0.12