mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +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
45bf773f60
commit
f4e7a35d64
1 changed files with 13 additions and 12 deletions
25
setup.py
25
setup.py
|
@ -534,18 +534,19 @@ class PyBuildExt(build_ext):
|
||||||
tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
|
tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
|
||||||
if not os.path.exists(self.build_temp):
|
if not os.path.exists(self.build_temp):
|
||||||
os.makedirs(self.build_temp)
|
os.makedirs(self.build_temp)
|
||||||
os.system("ldd %s > %s" % (do_readline, tmpfile))
|
ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
|
||||||
fp = open(tmpfile)
|
if ret >> 8 == 0:
|
||||||
for ln in fp:
|
fp = open(tmpfile)
|
||||||
if 'curses' in ln:
|
for ln in fp:
|
||||||
readline_termcap_library = re.sub(
|
if 'curses' in ln:
|
||||||
r'.*lib(n?cursesw?)\.so.*', r'\1', ln
|
readline_termcap_library = re.sub(
|
||||||
).rstrip()
|
r'.*lib(n?cursesw?)\.so.*', r'\1', ln
|
||||||
break
|
).rstrip()
|
||||||
if 'tinfo' in ln: # termcap interface split out from ncurses
|
break
|
||||||
readline_termcap_library = 'tinfo'
|
if 'tinfo' in ln: # termcap interface split out from ncurses
|
||||||
break
|
readline_termcap_library = 'tinfo'
|
||||||
fp.close()
|
break
|
||||||
|
fp.close()
|
||||||
os.unlink(tmpfile)
|
os.unlink(tmpfile)
|
||||||
# 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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue