]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-133741: Fix _can_strace(): check --trace option (#133766)
authorVictor Stinner <vstinner@python.org>
Fri, 9 May 2025 16:25:47 +0000 (18:25 +0200)
committerGitHub <noreply@github.com>
Fri, 9 May 2025 16:25:47 +0000 (18:25 +0200)
The --trace option needs strace 5.5 or newer.

Lib/test/support/strace_helper.py

index 798d6c6886962fa25c88464edbd47f4e4f75f950..1a9d2b520b7b2332d5e72097070f68e8a430b8c4 100644 (file)
@@ -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