diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-05-19 16:22:57 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-05-19 16:22:57 (GMT) |
commit | 822eb844006fb78a0551b0f55547b46cf8607e8a (patch) | |
tree | 7b44f9b425e5d10c342211894f23068d71fac584 /Lib/distutils/command/build_ext.py | |
parent | f84d7e9ed21294f6001345ddc6b2a8c4894ab70c (diff) | |
download | cpython-822eb844006fb78a0551b0f55547b46cf8607e8a.zip cpython-822eb844006fb78a0551b0f55547b46cf8607e8a.tar.gz cpython-822eb844006fb78a0551b0f55547b46cf8607e8a.tar.bz2 |
Merged revisions 72781 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72781 | tarek.ziade | 2009-05-19 18:17:21 +0200 (Tue, 19 May 2009) | 1 line
fixed the 'package' option of build_ext
........
Diffstat (limited to 'Lib/distutils/command/build_ext.py')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index eb4cb05..31e036b 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -629,19 +629,21 @@ class build_ext(Command): The file is located in `build_lib` or directly in the package (inplace option). """ - if self.inplace: - fullname = self.get_ext_fullname(ext_name) - 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)) - filename = self.get_ext_filename(ext_name) - return os.path.join(package_dir, filename) - else: - filename = self.get_ext_filename(ext_name) + fullname = self.get_ext_fullname(ext_name) + filename = self.get_ext_filename(fullname) + if not self.inplace: + # no further work needed return os.path.join(self.build_lib, filename) + # the inplace option requires to find the package directory + # using the build_py command + 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)) + return os.path.join(package_dir, filename) + def get_ext_fullname(self, ext_name): """Returns the fullname of a given extension name. |