[Python-checkins] cpython: - fix the OS X build failure, only try to remove the temporary file if it exists

matthias.klose python-checkins at python.org
Sat Jun 30 23:30:18 CEST 2012


http://hg.python.org/cpython/rev/900cf4e7a62f
changeset:   77893:900cf4e7a62f
user:        doko at ubuntu.com
date:        Sat Jun 30 23:28:09 2012 +0200
summary:
  - fix the OS X build failure, only try to remove the temporary file if it exists

files:
  setup.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -657,7 +657,7 @@
                 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 @@
                         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:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list