Issue #13901: Prevent test_packaging failures on OS X with --enable-shared.
authorNed Deily <nad@acm.org>
Fri, 3 Feb 2012 01:46:37 +0000 (02:46 +0100)
committerNed Deily <nad@acm.org>
Fri, 3 Feb 2012 01:46:37 +0000 (02:46 +0100)
Lib/packaging/tests/support.py

index 441efc061571a883b71ca9eeac17c7635f711066..4848bccd0172df0d670abd5fc317cb4700c73d40 100644 (file)
@@ -366,6 +366,9 @@ def fixup_build_ext(cmd):
         cmd = build_ext(dist)
         support.fixup_build_ext(cmd)
         cmd.ensure_finalized()
+
+    Unlike most other Unix platforms, Mac OS X embeds absolute paths
+    to shared libraries into executables, so the fixup is not needed there.
     """
     if os.name == 'nt':
         cmd.debug = sys.executable.endswith('_d.exe')
@@ -377,9 +380,11 @@ def fixup_build_ext(cmd):
         if runshared is None:
             cmd.library_dirs = ['.']
         else:
-            name, equals, value = runshared.partition('=')
-            cmd.library_dirs = value.split(os.pathsep)
-
+            if sys.platform == 'darwin':
+                cmd.library_dirs = []
+            else:
+                name, equals, value = runshared.partition('=')
+                cmd.library_dirs = value.split(os.pathsep)
 
 try:
     from test.support import skip_unless_symlink