bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7244)

Check which readline implementation is used based on the readline
docstring.
This commit is contained in:
Victor Stinner 2018-05-30 16:49:07 +02:00 committed by GitHub
parent be325e6132
commit f7a19c28bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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