Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 15, 2024
1 parent 488097d commit 7aa5db8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion line_profiler/autoprofile/autoprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ def run(script_file, ns, prof_mod, profile_imports=False):
tree_profiled = AstTreeProfiler(script_file, prof_mod, profile_imports).profile()

_extend_line_profiler_for_profiling_imports(ns[PROFILER_LOCALS_NAME])
exec(compile(tree_profiled, script_file, 'exec'), ns, ns)
code_obj = compile(tree_profiled, script_file, 'exec')
exec(code_obj, ns, ns)
4 changes: 2 additions & 2 deletions tests/test_autoprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def test_autoprofile_script_with_prof_imports():
# pytest.skip('Failing due to the noop bug')

args = [sys.executable, '-m', 'kernprof', '--prof-imports', '-p', 'script.py', '-l', os.fspath(script_fpath)]
proc = ub.cmd(args, cwd=temp_dpath, verbose=3)
proc = ub.cmd(args, cwd=temp_dpath, verbose=0)
print('Kernprof Stdout:')
print(proc.stdout)
print('Kernprof Stderr:')
Expand All @@ -322,7 +322,7 @@ def test_autoprofile_script_with_prof_imports():
proc.check_returncode()

args = [sys.executable, '-m', 'line_profiler', os.fspath(script_fpath) + '.lprof']
proc = ub.cmd(args, cwd=temp_dpath, verbose=3)
proc = ub.cmd(args, cwd=temp_dpath, verbose=0)
raw_output = proc.stdout
print('Line_profile Stdout:')
print(raw_output)
Expand Down

0 comments on commit 7aa5db8

Please sign in to comment.