mirror of
https://github.com/python/cpython.git
synced 2025-08-15 22:30:42 +00:00
Issue #7384: On Gentoo, libreadline.so is a "fake library", so ldd fails.
In that case, do not attempt to parse stderr output.
This commit is contained in:
parent
05b7631c17
commit
2e26e23d9d
1 changed files with 12 additions and 10 deletions
22
setup.py
22
setup.py
|
@ -594,16 +594,18 @@ class PyBuildExt(build_ext):
|
||||||
# Determine if readline is already linked against curses or tinfo.
|
# Determine if readline is already linked against curses or tinfo.
|
||||||
if do_readline and find_executable('ldd'):
|
if do_readline and find_executable('ldd'):
|
||||||
fp = os.popen("ldd %s" % do_readline)
|
fp = os.popen("ldd %s" % do_readline)
|
||||||
for ln in fp:
|
ldd_output = fp.readlines()
|
||||||
if 'curses' in ln:
|
ret = fp.close()
|
||||||
readline_termcap_library = re.sub(
|
if ret is None or ret >> 8 == 0:
|
||||||
r'.*lib(n?cursesw?)\.so.*', r'\1', ln
|
for ln in ldd_output:
|
||||||
).rstrip()
|
if 'curses' in ln:
|
||||||
break
|
readline_termcap_library = re.sub(
|
||||||
if 'tinfo' in ln: # termcap interface split out from ncurses
|
r'.*lib(n?cursesw?)\.so.*', r'\1', ln
|
||||||
readline_termcap_library = 'tinfo'
|
).rstrip()
|
||||||
break
|
break
|
||||||
fp.close()
|
if 'tinfo' in ln: # termcap interface split out from ncurses
|
||||||
|
readline_termcap_library = 'tinfo'
|
||||||
|
break
|
||||||
# Issue 7384: If readline is already linked against curses,
|
# Issue 7384: If readline is already linked against curses,
|
||||||
# use the same library for the readline and curses modules.
|
# use the same library for the readline and curses modules.
|
||||||
if 'curses' in readline_termcap_library:
|
if 'curses' in readline_termcap_library:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue