[Python-checkins] r85784 - python/branches/release27-maint/Lib/distutils/tests/test_build_ext.py

barry.warsaw python-checkins at python.org
Fri Oct 22 00:13:30 CEST 2010


Author: barry.warsaw
Date: Fri Oct 22 00:13:29 2010
New Revision: 85784

Log:
Fix issue 10126 for Python 2.7 by using $RUNSHARED to find the
directory to the shared library.  test_distutils now passes when
Python was built with --enable-shared.



Modified:
   python/branches/release27-maint/Lib/distutils/tests/test_build_ext.py

Modified: python/branches/release27-maint/Lib/distutils/tests/test_build_ext.py
==============================================================================
--- python/branches/release27-maint/Lib/distutils/tests/test_build_ext.py	(original)
+++ python/branches/release27-maint/Lib/distutils/tests/test_build_ext.py	Fri Oct 22 00:13:29 2010
@@ -60,8 +60,12 @@
         # Extension() instance because that doesn't get plumbed through to the
         # final compiler command.
         if not sys.platform.startswith('win'):
-            library_dir = sysconfig.get_config_var('srcdir')
-            cmd.library_dirs = [('.' if library_dir is None else library_dir)]
+            runshared = sysconfig.get_config_var('RUNSHARED')
+            if runshared is None:
+                cmd.library_dirs = ['.']
+            else:
+                name, equals, value = runshared.partition('=')
+                cmd.library_dirs = value.split(os.pathsep)
 
     @unittest.skipIf(not os.path.exists(_XX_MODULE_PATH),
                      'xxmodule.c not found')
@@ -265,6 +269,7 @@
         dist = Distribution({'name': 'xx',
                              'ext_modules': [ext]})
         cmd = build_ext(dist)
+        self._fixup_command(cmd)
         cmd.ensure_finalized()
         self.assertEquals(len(cmd.get_outputs()), 1)
 


More information about the Python-checkins mailing list