diff options
author | Stefan Krah <stefan@bytereef.org> | 2010-07-17 12:31:09 (GMT) |
---|---|---|
committer | Stefan Krah <stefan@bytereef.org> | 2010-07-17 12:31:09 (GMT) |
commit | 818ea8ed1171ffb87f74d1ba7fc4e4fecbd4a2ba (patch) | |
tree | 1181842490b08bee56f3dfc70cf98c55cfaa92a1 /setup.py | |
parent | edc0d2338d4df38ddf9d9d37d7d0f0e14d9fc628 (diff) | |
download | cpython-818ea8ed1171ffb87f74d1ba7fc4e4fecbd4a2ba.zip cpython-818ea8ed1171ffb87f74d1ba7fc4e4fecbd4a2ba.tar.gz cpython-818ea8ed1171ffb87f74d1ba7fc4e4fecbd4a2ba.tar.bz2 |
Merged revisions 82929 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint
........
r82929 | stefan.krah | 2010-07-17 14:21:08 +0200 (Sat, 17 Jul 2010) | 4 lines
Issue #7384: On Gentoo, libreadline.so is a "fake library", so ldd fails.
In that case, do not attempt to parse stderr output.
........
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -607,16 +607,18 @@ class PyBuildExt(build_ext): # Determine if readline is already linked against curses or tinfo. if do_readline and find_executable('ldd'): fp = os.popen("ldd %s" % do_readline) - for ln in fp: - if 'curses' in ln: - readline_termcap_library = re.sub( - r'.*lib(n?cursesw?)\.so.*', r'\1', ln - ).rstrip() - break - if 'tinfo' in ln: # termcap interface split out from ncurses - readline_termcap_library = 'tinfo' - break - fp.close() + ldd_output = fp.readlines() + ret = fp.close() + if ret is None or ret >> 8 == 0: + for ln in ldd_output: + if 'curses' in ln: + readline_termcap_library = re.sub( + r'.*lib(n?cursesw?)\.so.*', r'\1', ln + ).rstrip() + break + if 'tinfo' in ln: # termcap interface split out from ncurses + readline_termcap_library = 'tinfo' + break # Issue 7384: If readline is already linked against curses, # use the same library for the readline and curses modules. # Disabled since applications relying on ncursesw might break. |