From: Victor Stinner Date: Wed, 30 May 2018 14:49:07 +0000 (+0200) Subject: bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7244) X-Git-Tag: v3.6.6rc1~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7a19c28bda7b0ed3a440db80202013a86af6850;p=python bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7244) Check which readline implementation is used based on the readline docstring. --- diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index f1b02336f7..26f493ee29 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