From f084376f23ee20a972a1fb28f9fd5366f8fd2439 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 21 Oct 2010 22:13:29 +0000 Subject: [PATCH] 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. --- Lib/distutils/tests/test_build_ext.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 154771f2c79..e04593065d1 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -60,8 +60,12 @@ class BuildExtTestCase(support.TempdirManager, # 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 @@ class BuildExtTestCase(support.TempdirManager, 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)