File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -497,6 +497,34 @@ def collect_test_support(info_add):
497497 call_func (info_add , 'test_support.python_is_optimized' , support , 'python_is_optimized' )
498498
499499
500+ def collect_cc (info_add ):
501+ import subprocess
502+ import sysconfig
503+
504+ CC = sysconfig .get_config_var ('CC' )
505+ if not CC :
506+ return
507+
508+ try :
509+ import shlex
510+ args = shlex .split (CC )
511+ except ImportError :
512+ args = CC .split ()
513+ args .append ('--version' )
514+ proc = subprocess .Popen (args ,
515+ stdout = subprocess .PIPE ,
516+ stderr = subprocess .STDOUT ,
517+ universal_newlines = True )
518+ stdout = proc .communicate ()[0 ]
519+ if proc .returncode :
520+ # CC --version failed: ignore error
521+ return
522+
523+ text = stdout .splitlines ()[0 ]
524+ text = normalize_text (text )
525+ info_add ('CC.version' , text )
526+
527+
500528def collect_info (info ):
501529 error = False
502530 info_add = info .add
@@ -523,6 +551,7 @@ def collect_info(info):
523551 collect_decimal ,
524552 collect_testcapi ,
525553 collect_resource ,
554+ collect_cc ,
526555
527556 # Collecting from tests should be last as they have side effects.
528557 collect_test_socket ,
You can’t perform that action at this time.
0 commit comments