mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[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 67086282fc
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
4e57e213d6
commit
5e730a8baa
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue