From 19fe0c8cec43547273ad133791a298396955461b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Fri, 13 Feb 2009 23:02:44 +0000 Subject: Merged revisions 69598 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r69598 | tarek.ziade | 2009-02-14 00:00:43 +0100 (Sat, 14 Feb 2009) | 1 line Fixed #4524: distutils build_script command failed with --with-suffix=3 ........ --- Lib/distutils/command/build_scripts.py | 4 ++-- Lib/distutils/tests/test_build_scripts.py | 28 ++++++++++++++++++++++++++++ Misc/NEWS | 3 +++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index 104be0b..453330f 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -104,8 +104,8 @@ class build_scripts (Command): outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), - "python" + sysconfig.get_config_var("VERSION") - + sysconfig.get_config_var("EXE")), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() diff --git a/Lib/distutils/tests/test_build_scripts.py b/Lib/distutils/tests/test_build_scripts.py index 666ca44..2acfab8 100644 --- a/Lib/distutils/tests/test_build_scripts.py +++ b/Lib/distutils/tests/test_build_scripts.py @@ -5,6 +5,7 @@ import unittest from distutils.command.build_scripts import build_scripts from distutils.core import Distribution +from distutils import sysconfig from distutils.tests import support @@ -73,6 +74,33 @@ class BuildScriptsTestCase(support.TempdirManager, f.write(text) f.close() + def test_version_int(self): + source = self.mkdtemp() + target = self.mkdtemp() + expected = self.write_sample_scripts(source) + + + cmd = self.get_build_scripts_cmd(target, + [os.path.join(source, fn) + for fn in expected]) + cmd.finalize_options() + + # http://bugs.python.org/issue4524 + # + # On linux-g++-32 with command line `./configure --enable-ipv6 + # --with-suffix=3`, python is compiled okay but the build scripts + # failed when writing the name of the executable + old = sysconfig._config_vars.get('VERSION') + sysconfig._config_vars['VERSION'] = 4 + try: + cmd.run() + finally: + if old is not None: + sysconfig._config_vars['VERSION'] = old + + built = os.listdir(target) + for name in expected: + self.assert_(name in built) def test_suite(): return unittest.makeSuite(BuildScriptsTestCase) diff --git a/Misc/NEWS b/Misc/NEWS index de3f6be..9b734d0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -80,6 +80,9 @@ Core and Builtins Library ------- +- Issue #4524: distutils build_script command failed with --with-suffix=3. + Initial patch by Amaury Forgeot d'Arc. + - Issue #4998: The memory saving effect of __slots__ had been lost on Fractions which inherited from numbers.py which did not have __slots__ defined. The numbers hierarchy now has its own __slots__ declarations. -- cgit v0.12