Skip to content

Commit 5e730a8

Browse files
[3.14] gh-133741: Fix _can_strace(): check --trace option (GH-133766) (#133774)
gh-133741: Fix _can_strace(): check --trace option (GH-133766) The --trace option needs strace 5.5 or newer. (cherry picked from commit 6708628) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 4e57e21 commit 5e730a8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/support/strace_helper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ def get_syscalls(code, strace_flags, prelude="", cleanup="",
178178
# Moderately expensive (spawns a subprocess), so share results when possible.
179179
@cache
180180
def _can_strace():
181-
res = strace_python("import sys; sys.exit(0)", [], check=False)
181+
res = strace_python("import sys; sys.exit(0)",
182+
# --trace option needs strace 5.5 (gh-133741)
183+
["--trace=%process"],
184+
check=False)
182185
if res.strace_returncode == 0 and res.python_returncode == 0:
183186
assert res.events(), "Should have parsed multiple calls"
184187
return True

0 commit comments

Comments
 (0)