https://github.com/python/cpython/commit/c4aeb4c444237dd3a6571d23c9dcad91f7987c1d
commit: c4aeb4c444237dd3a6571d23c9dcad91f7987c1d
branch: 3.12
author: Victor Stinner <vstin...@python.org>
committer: vstinner <vstin...@python.org>
date: 2025-02-26T12:38:21+01:00
summary:

[3.12] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) 
(#130573)

GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)

(cherry picked from commit 129db32d6f2d7f450d2741da6a222c18e458c61b)

Co-authored-by: Mark Shannon <m...@hotpy.org>

files:
M Lib/test/support/__init__.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index ba57eb307c0b8f..c8993476240de1 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -799,7 +799,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():

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to