summaryrefslogtreecommitdiff
path: root/Lib/test/pythoninfo.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-05-30 16:49:07 +0200
committerGitHub <noreply@github.com>2018-05-30 16:49:07 +0200
commitf7a19c28bda7b0ed3a440db80202013a86af6850 (patch)
treea0319eb65f7663983b0002e1a3676efde8fbaf64 /Lib/test/pythoninfo.py
parentbe325e6132c9198f7b8e9c7da2dd0017a33212cc (diff)
downloadcpython-git-f7a19c28bda7b0ed3a440db80202013a86af6850.tar.gz
bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7244)
Check which readline implementation is used based on the readline docstring.
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r--Lib/test/pythoninfo.py8
1 files changed, 8 insertions, 0 deletions
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