From: doko@ubuntu.com Date: Sat, 30 Jun 2012 21:28:09 +0000 (+0200) Subject: - fix the OS X build failure, only try to remove the temporary file if it exists X-Git-Tag: v3.3.0b2~352 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c99071c9be1cf81e915ebfcb17dcf50c6e489d6;p=thirdparty%2FPython%2Fcpython.git - fix the OS X build failure, only try to remove the temporary file if it exists --- diff --git a/setup.py b/setup.py index c1d6968a4e2c..fa7bf2ed1fdc 100644 --- a/setup.py +++ b/setup.py @@ -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,7 +669,8 @@ class PyBuildExt(build_ext): if 'tinfo' in ln: readline_termcap_library = 'tinfo' break - os.unlink(tmpfile) + 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. if 'curses' in readline_termcap_library: