[Python-checkins] r75390 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS

tarek.ziade python-checkins at python.org
Tue Oct 13 00:38:35 CEST 2009


Author: tarek.ziade
Date: Tue Oct 13 00:38:34 2009
New Revision: 75390

Log:
Fixed #7115: using paths instead of dotted name for extensions works too in distutils.command.build_ext

Modified:
   python/branches/release26-maint/Lib/distutils/command/build_ext.py
   python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py
   python/branches/release26-maint/Misc/NEWS

Modified: python/branches/release26-maint/Lib/distutils/command/build_ext.py
==============================================================================
--- python/branches/release26-maint/Lib/distutils/command/build_ext.py	(original)
+++ python/branches/release26-maint/Lib/distutils/command/build_ext.py	Tue Oct 13 00:38:34 2009
@@ -628,6 +628,8 @@
         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)

Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py
==============================================================================
--- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py	(original)
+++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py	Tue Oct 13 00:38:34 2009
@@ -363,6 +363,16 @@
         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:

Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Tue Oct 13 00:38:34 2009
@@ -18,6 +18,9 @@
 Library
 -------
 
+- Issue #7115: Fixed the extension module builds that is failing when using 
+  paths in the extension name instead of dotted names.
+
 - Issue #7068: Fixed the partial renaming that occured in r72594.
 
 - Issue #7064: Fixed the incompatibility with Setuptools in distutils 


More information about the Python-checkins mailing list