]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)
authorMark Shannon <mark@hotpy.org>
Wed, 26 Feb 2025 09:01:58 +0000 (09:01 +0000)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 09:01:58 +0000 (09:01 +0000)
Lib/test/support/__init__.py

index 0127ab6888a1d3b53db3976e730e462ec869fd05..37a69fda8ef74c1771d5cd5162d8e052b522f090 100644 (file)
@@ -835,7 +835,6 @@ def gc_threshold(*args):
     finally:
         gc.set_threshold(*old_threshold)
 
-
 def python_is_optimized():
     """Find if Python was built with optimizations."""
     cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
@@ -843,7 +842,11 @@ def python_is_optimized():
     for opt in cflags.split():
         if opt.startswith('-O'):
             final_opt = opt
-    return final_opt not in ('', '-O0', '-Og')
+    if sysconfig.get_config_var("CC") == "gcc":
+        non_opts = ('', '-O0', '-Og')
+    else:
+        non_opts = ('', '-O0')
+    return final_opt not in non_opts
 
 
 def check_cflags_pgo():