]> granicus.if.org Git - python/commitdiff
bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7293)
authorVictor Stinner <vstinner@redhat.com>
Fri, 1 Jun 2018 09:04:29 +0000 (11:04 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Jun 2018 09:04:29 +0000 (11:04 +0200)
Check which readline implementation is used based on the readline
docstring.

Lib/test/pythoninfo.py

index 776f03f8b58b5cdabc3cc607f1d20e4f9d73a3e9..9242a36bedd68b2447d40da3b5f6eec51cf1b1ab 100644 (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