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

Victor Stinner webhook-mailer at python.org
Wed May 30 10:49:10 EDT 2018


https://github.com/python/cpython/commit/f7a19c28bda7b0ed3a440db80202013a86af6850
commit: f7a19c28bda7b0ed3a440db80202013a86af6850
branch: 3.6
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-05-30T16:49:07+02:00
summary:

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

Check which readline implementation is used based on the readline
docstring.

files:
M Lib/test/pythoninfo.py

diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index f1b02336f7e3..26f493ee29ff 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -275,6 +275,14 @@ def format_attr(attr, value):
     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



More information about the Python-checkins mailing list