Skip to content

Commit

Permalink
bpo-33692: pythoninfo detect libedit on Python 2.7 (#7246)
Browse files Browse the repository at this point in the history
Check which readline implementation is used based on the readline
docstring.
  • Loading branch information
vstinner committed May 30, 2018
1 parent 823c295 commit 9994eff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/test/pythoninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9994eff

Please sign in to comment.