[Python-checkins] distutils2: Port OS X --enable-shared fix from packaging (#13901; untested)

eric.araujo python-checkins at python.org
Sun Feb 5 12:23:57 CET 2012


http://hg.python.org/distutils2/rev/e6a28ae0dfd6
changeset:   1270:e6a28ae0dfd6
user:        Éric Araujo <merwok at netwok.org>
date:        Sun Feb 05 11:42:49 2012 +0100
summary:
  Port OS X --enable-shared fix from packaging (#13901; untested)

files:
  CHANGES.txt                 |   1 +
  distutils2/tests/support.py |  13 +++++++++----
  2 files changed, 10 insertions(+), 4 deletions(-)


diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -160,6 +160,7 @@
 - Remove verbose arguments for Command and Compiler classes as well as util
   functions, obsoleted by logging [éric]
 - #12659: Add tests for tests.support [francisco]
+- #13901: Prevent test failure on OS X for Python built in shared mode [ned]
 
 
 1.0a3 - 2010-10-08
diff --git a/distutils2/tests/support.py b/distutils2/tests/support.py
--- a/distutils2/tests/support.py
+++ b/distutils2/tests/support.py
@@ -357,7 +357,9 @@
 
     When Python was built with --enable-shared on Unix, -L. is not enough to
     find libpython<blah>.so, because regrtest runs in a tempdir, not in the
-    source directory where the .so lives.
+    source directory where the .so lives.  (Mac OS X embeds absolute paths
+    to shared libraries into executables, so the fixup is a no-op on that
+    platform.)
 
     When Python was built with in debug mode on Windows, build_ext commands
     need their debug attribute set, and it is not done automatically for
@@ -379,9 +381,12 @@
         if runshared is None:
             cmd.library_dirs = ['.']
         else:
-            # FIXME no partition in 2.4
-            name, equals, value = runshared.partition('=')
-            cmd.library_dirs = value.split(os.pathsep)
+            if sys.platform == 'darwin':
+                cmd.library_dirs = []
+            else:
+                # FIXME no partition in 2.4
+                name, equals, value = runshared.partition('=')
+                cmd.library_dirs = value.split(os.pathsep)
 
 
 try:

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


More information about the Python-checkins mailing list