From: Victor Stinner Date: Wed, 30 May 2018 21:36:04 +0000 (+0200) Subject: bpo-33692: pythoninfo detect libedit on Python 2.7 (#7246) X-Git-Tag: v2.7.16rc1~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9994eff17f943fb2c190708b12c96fef9838a425;p=thirdparty%2FPython%2Fcpython.git bpo-33692: pythoninfo detect libedit on Python 2.7 (#7246) Check which readline implementation is used based on the readline docstring. --- diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index f40ff8d0eba1..92b515803991 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -275,6 +275,14 @@ def collect_readline(info_add): copy_attributes(info_add, readline, 'readline.%s', attributes, formatter=format_attr) + if not hasattr(readline, "_READLINE_LIBRARY_VERSION"): + # _READLINE_LIBRARY_VERSION has been added to CPython 3.7 + doc = getattr(readline, '__doc__', '') + if 'libedit readline' in doc: + info_add('readline.library', 'libedit readline') + elif 'GNU readline' in doc: + info_add('readline.library', 'GNU readline') + def collect_gdb(info_add): import subprocess