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.
This commit is contained in:
parent
e9df5d6866
commit
f084376f23
|
@ -60,8 +60,12 @@ class BuildExtTestCase(support.TempdirManager,
|
||||||
# Extension() instance because that doesn't get plumbed through to the
|
# Extension() instance because that doesn't get plumbed through to the
|
||||||
# final compiler command.
|
# final compiler command.
|
||||||
if not sys.platform.startswith('win'):
|
if not sys.platform.startswith('win'):
|
||||||
library_dir = sysconfig.get_config_var('srcdir')
|
runshared = sysconfig.get_config_var('RUNSHARED')
|
||||||
cmd.library_dirs = [('.' if library_dir is None else library_dir)]
|
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),
|
@unittest.skipIf(not os.path.exists(_XX_MODULE_PATH),
|
||||||
'xxmodule.c not found')
|
'xxmodule.c not found')
|
||||||
|
@ -265,6 +269,7 @@ class BuildExtTestCase(support.TempdirManager,
|
||||||
dist = Distribution({'name': 'xx',
|
dist = Distribution({'name': 'xx',
|
||||||
'ext_modules': [ext]})
|
'ext_modules': [ext]})
|
||||||
cmd = build_ext(dist)
|
cmd = build_ext(dist)
|
||||||
|
self._fixup_command(cmd)
|
||||||
cmd.ensure_finalized()
|
cmd.ensure_finalized()
|
||||||
self.assertEquals(len(cmd.get_outputs()), 1)
|
self.assertEquals(len(cmd.get_outputs()), 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue