- fix the OS X build failure, only try to remove the temporary file if it exists

This commit is contained in:
doko@ubuntu.com 2012-06-30 23:28:09 +02:00
parent 7f7902ce9c
commit 4c99071c9b
1 changed files with 3 additions and 2 deletions

View File

@ -657,7 +657,7 @@ class PyBuildExt(build_ext):
ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
else:
ret = 256
if ret == 0:
if ret >> 8 == 0:
with open(tmpfile) as fp:
for ln in fp:
if 'curses' in ln:
@ -669,6 +669,7 @@ class PyBuildExt(build_ext):
if 'tinfo' in ln:
readline_termcap_library = 'tinfo'
break
if os.path.exists(tmpfile):
os.unlink(tmpfile)
# Issue 7384: If readline is already linked against curses,
# use the same library for the readline and curses modules.