8000 gh-133741: Fix _can_strace(): check --trace option by vstinner · Pull Request #133766 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-133741: Fix _can_strace(): check --trace option #133766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
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
gh-133741: Fix _can_strace(): check --trace option
The --trace option needs strace 5.5 or newer.
  • Loading branch information
vstinner committed May 9, 2025
commit 09209d3955bcb1c5bfc7c00c31cdba20a5b64aa8
5 changes: 4 additions & 1 deletion Lib/test/support/strace_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def get_syscalls(code, strace_flags, prelude="", cleanup="",
# Moderately expensive (spawns a subprocess), so share results when possible.
@cache
def _can_strace():
res = strace_python("import sys; sys.exit(0)", [], check=False)
res = strace_python("import sys; sys.exit(0)",
# --trace option needs strace 5.5 (gh-133741)
["--trace=%process"],
check=False)
if res.strace_returncode == 0 and res.python_returncode == 0:
assert res.events(), "Should have parsed multiple calls"
return True
Expand Down
Loading
0