From 8a3e3459131c38aa216a51eb0aa758063059d0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarek=20Ziad=C3=A9?= Date: Wed, 9 Sep 2009 11:39:41 +0000 Subject: [PATCH] removed unecessary lines for clarity and added a the same test than in trunk for the inplace --- Lib/distutils/command/build_ext.py | 3 --- Lib/distutils/tests/test_build_ext.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index db82f1d0d69..a3e3982f6d6 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -642,9 +642,6 @@ class build_ext (Command): # the inplace option requires to find the package directory # using the build_py command for that package = '.'.join(modpath[0:-1]) - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] build_py = self.get_finalized_command('build_py') package_dir = os.path.abspath(build_py.get_package_dir(package)) diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 153c8756441..d8d3667751f 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -329,6 +329,19 @@ class BuildExtTestCase(support.TempdirManager, wanted = os.path.join(curdir, 'twisted', 'runner', 'portmap' + ext) self.assertEquals(wanted, path) + def test_build_ext_inplace(self): + etree_c = os.path.join(self.tmp_dir, 'lxml.etree.c') + etree_ext = Extension('lxml.etree', [etree_c]) + dist = Distribution({'name': 'lxml', 'ext_modules': [etree_ext]}) + cmd = build_ext(dist) + cmd.inplace = 1 + cmd.distribution.package_dir = {'': 'src'} + cmd.distribution.packages = ['lxml', 'lxml.html'] + curdir = os.getcwd() + wanted = os.path.join(curdir, 'src', 'lxml', 'etree.so') + path = cmd.get_ext_fullpath('lxml.etree') + self.assertEquals(wanted, path) + def test_suite(): if not sysconfig.python_build: if test_support.verbose: