[Python-checkins] r82928 - in python/branches/release31-maint: setup.py

stefan.krah python-checkins at python.org
Sat Jul 17 13:48:58 CEST 2010


Author: stefan.krah
Date: Sat Jul 17 13:48:58 2010
New Revision: 82928

Log:
Merged revisions 82927 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r82927 | stefan.krah | 2010-07-17 13:46:52 +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.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/setup.py

Modified: python/branches/release31-maint/setup.py
==============================================================================
--- python/branches/release31-maint/setup.py	(original)
+++ python/branches/release31-maint/setup.py	Sat Jul 17 13:48:58 2010
@@ -547,18 +547,19 @@
             tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
             if not os.path.exists(self.build_temp):
                 os.makedirs(self.build_temp)
-            os.system("ldd %s > %s" % (do_readline, tmpfile))
-            fp = open(tmpfile)
-            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()
+            ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
+            if ret >> 8 == 0:
+                fp = open(tmpfile)
+                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()
             os.unlink(tmpfile)
         # Issue 7384: If readline is already linked against curses,
         # use the same library for the readline and curses modules.


More information about the Python-checkins mailing list