diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-10-12 22:38:34 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-10-12 22:38:34 (GMT) |
commit | ff0d8a36befda1fbecf11d76921f9e34632c181b (patch) | |
tree | b1c3c7aa742fcbd2f8af46268ab9b4d18401bc80 /Lib/distutils | |
parent | dff2028a1b8d680cc489bb3ffb8a5b120e772c8a (diff) | |
download | cpython-ff0d8a36befda1fbecf11d76921f9e34632c181b.zip cpython-ff0d8a36befda1fbecf11d76921f9e34632c181b.tar.gz cpython-ff0d8a36befda1fbecf11d76921f9e34632c181b.tar.bz2 |
Fixed #7115: using paths instead of dotted name for extensions works too in distutils.command.build_ext
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 2 | ||||
-rw-r--r-- | Lib/distutils/tests/test_build_ext.py | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index da9cbfd..abc1584 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -628,6 +628,8 @@ class build_ext (Command): The file is located in `build_lib` or directly in the package (inplace option). """ + if os.sep in ext_name: + ext_name = ext_name.replace(os.sep, '.') fullname = self.get_ext_fullname(ext_name) modpath = fullname.split('.') filename = self.get_ext_filename(ext_name) diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 00733a4..5dffe2c 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -363,6 +363,16 @@ class BuildExtTestCase(support.TempdirManager, path = cmd.get_ext_fullpath('lxml.etree') self.assertEquals(wanted, path) + def test_build_ext_path_with_os_sep(self): + dist = Distribution({'name': 'UpdateManager'}) + cmd = build_ext(dist) + cmd.ensure_finalized() + ext = sysconfig.get_config_var("SO") + ext_name = os.path.join('UpdateManager', 'fdsend') + ext_path = cmd.get_ext_fullpath(ext_name) + wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' + ext) + self.assertEquals(ext_path, wanted) + def test_suite(): if not sysconfig.python_build: if test_support.verbose: |