Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Lib/test/test_perf_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def run_perf(cwd, *args, use_jit=False, **env_vars):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
env=env,
text=True,
)
if proc.returncode:
print(proc.stderr, file=sys.stderr)
Expand All @@ -327,10 +328,10 @@ def run_perf(cwd, *args, use_jit=False, **env_vars):
jit_output_file = cwd + "/jit_output.dump"
command = ("perf", "inject", "-j", "-i", output_file, "-o", jit_output_file)
proc = subprocess.run(
command, stderr=subprocess.PIPE, stdout=subprocess.PIPE, env=env
command, stderr=subprocess.PIPE, stdout=subprocess.PIPE, env=env, text=True
)
if proc.returncode:
print(proc.stderr)
print(proc.stderr, file=sys.stderr)
raise ValueError(f"Perf failed with return code {proc.returncode}")
# Copy the jit_output_file to the output_file
os.rename(jit_output_file, output_file)
Expand All @@ -342,10 +343,9 @@ def run_perf(cwd, *args, use_jit=False, **env_vars):
stderr=subprocess.PIPE,
env=env,
check=True,
text=True,
)
return proc.stdout.decode("utf-8", "replace"), proc.stderr.decode(
"utf-8", "replace"
)
return proc.stdout, proc.stderr


class TestPerfProfilerMixin:
Expand Down
Loading