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 @@ -489,6 +489,34 @@ def collect_test_support(info_add):
489489 call_func (info_add , 'test_support.python_is_optimized' , support , 'python_is_optimized' )
490490
491491
492+ def collect_cc (info_add ):
493+ import subprocess
494+ import sysconfig
495+
496+ CC = sysconfig .get_config_var ('CC' )
497+ if not CC :
498+ return
499+
500+ try :
501+ import shlex
502+ args = shlex .split (CC )
503+ except ImportError :
504+ args = CC .split ()
505+ args .append ('--version' )
506+ proc = subprocess .Popen (args ,
507+ stdout = subprocess .PIPE ,
508+ stderr = subprocess .STDOUT ,
509+ universal_newlines = True )
510+ stdout = proc .communicate ()[0 ]
511+ if proc .returncode :
512+ # CC --version failed: ignore error
513+ return
514+
515+ text = stdout .splitlines ()[0 ]
516+ text = normalize_text (text )
517+ info_add ('CC.version' , text )
518+
519+
492520def collect_info (info ):
493521 error = False
494522 info_add = info .add
@@ -515,6 +543,7 @@ def collect_info(info):
515543 collect_decimal ,
516544 collect_testcapi ,
517545 collect_resource ,
546+ collect_cc ,
518547
519548 # Collecting from tests should be last as they have side effects.
520549 collect_test_socket ,
You can’t perform that action at this time.
0 commit comments