From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 9 May 2025 16:52:23 +0000 (+0200) Subject: [3.14] gh-133741: Fix _can_strace(): check --trace option (GH-133766) (#133774) X-Git-Tag: v3.14.0b2~201 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e730a8baa8a6d321f14f91b95b47e5d617b5f0c;p=thirdparty%2FPython%2Fcpython.git [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 67086282fcc1fc944be2e723cfc05de16109793a) Co-authored-by: Victor Stinner --- diff --git a/Lib/test/support/strace_helper.py b/Lib/test/support/strace_helper.py index 798d6c688696..1a9d2b520b7b 100644 --- a/Lib/test/support/strace_helper.py +++ b/Lib/test/support/strace_helper.py @@ -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