@@ -275,6 +275,14 @@ def format_attr(attr, value):
275
275
copy_attributes (info_add , readline , 'readline.%s' , attributes ,
276
276
formatter = format_attr )
277
277
278
+ if not hasattr (readline , "_READLINE_LIBRARY_VERSION" ):
279
+ # _READLINE_LIBRARY_VERSION has been added to CPython 3.7
280
+ doc = getattr (readline , '__doc__' , '' )
281
+ if 'libedit readline' in doc :
282
+ info_add ('readline.library' , 'libedit readline' )
283
+ elif 'GNU readline' in doc :
284
+ info_add ('readline.library' , 'GNU readline' )
285
+
278
286
279
287
def collect_gdb (info_add ):
280
288
import subprocess
@@ -489,6 +497,34 @@ def collect_test_support(info_add):
489
497
call_func (info_add , 'test_support.python_is_optimized' , support , 'python_is_optimized' )
490
498
491
499
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
+
492
528
def collect_info (info ):
493
529
error = False
494
530
info_add = info .add
@@ -515,6 +551,7 @@ def collect_info(info):
515
551
collect_decimal ,
516
552
collect_testcapi ,
517
553
collect_resource ,
554
+ collect_cc ,
518
555
519
556
# Collecting from tests should be last as they have side effects.
520
557
collect_test_socket ,
0 commit comments