Fixed 6365: wrong inplace location for build_ext if the extension had dots

This commit is contained in:
Tarek Ziadé 2009-06-29 16:13:39 +00:00
parent 5c3dd9a1ee
commit 3fbcc60eb8
3 changed files with 22 additions and 7 deletions

View file

@ -643,16 +643,16 @@ class build_ext (Command):
(inplace option).
"""
fullname = self.get_ext_fullname(ext_name)
filename = self.get_ext_filename(fullname)
modpath = fullname.split('.')
package = '.'.join(modpath[0:-1])
base = modpath[-1]
filename = self.get_ext_filename(base)
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)