https://github.com/python/cpython/commit/26ccc733c7c4ff2dbb0c99eb406465020a736acd
commit: 26ccc733c7c4ff2dbb0c99eb406465020a736acd
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-06-26T21:16:42Z
summary:

[3.13] gh-98894: Skip test_dtrace when building without dtrace (GH-152239) 
(#152302)

gh-98894: Skip test_dtrace when building without dtrace (GH-152239)
(cherry picked from commit 671357691f84820d4a4799012e937ab9dcbfdaca)

Co-authored-by: stratakis <[email protected]>

files:
M Lib/test/test_dtrace.py

diff --git a/Lib/test/test_dtrace.py b/Lib/test/test_dtrace.py
index ba2fa99707cd46..d2ff10c57a0982 100644
--- a/Lib/test/test_dtrace.py
+++ b/Lib/test/test_dtrace.py
@@ -13,6 +13,10 @@
 
 if not support.has_subprocess_support:
     raise unittest.SkipTest("test module requires subprocess")
+if not sysconfig.get_config_var('WITH_DTRACE'):
+    raise unittest.SkipTest(
+        "CPython must be configured with the --with-dtrace option."
+    )
 
 
 def abspath(filename):
@@ -178,12 +182,9 @@ class SystemTapOptimizedTests(TraceTests, 
unittest.TestCase):
 class CheckDtraceProbes(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
-        if sysconfig.get_config_var('WITH_DTRACE'):
-            readelf_major_version, readelf_minor_version = 
cls.get_readelf_version()
-            if support.verbose:
-                print(f"readelf version: 
{readelf_major_version}.{readelf_minor_version}")
-        else:
-            raise unittest.SkipTest("CPython must be configured with the 
--with-dtrace option.")
+        readelf_major_version, readelf_minor_version = 
cls.get_readelf_version()
+        if support.verbose:
+            print(f"readelf version: 
{readelf_major_version}.{readelf_minor_version}")
 
 
     @staticmethod

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to