Commits

tarek  committed e07e530

make sure setuptools does like distutils in get_ext_filename fixes #41

  • Participants
  • Parent commits f086a7e
  • Branches 0.6-maintenance

Comments (0)

Files changed (2)

File setuptools/command/build_ext.py

 
     def get_ext_filename(self, fullname):
         filename = _build_ext.get_ext_filename(self,fullname)
+        if fullname not in self.ext_map:
+            return filename
         ext = self.ext_map[fullname]
         if isinstance(ext,Library):
             fn, ext = os.path.splitext(filename)

File setuptools/tests/test_build_ext.py

+"""build_ext tests
+"""
+import os, shutil, tempfile, unittest
+from distutils.command.build_ext import build_ext as distutils_build_ext
+from setuptools.command.build_ext import build_ext
+from setuptools.dist import Distribution
+
+class TestBuildExtTest(unittest.TestCase):
+
+    def test_get_ext_filename(self):
+        # setuptools needs to give back the same
+        # result than distutils, even if the fullname
+        # is not in ext_map
+        dist = Distribution()
+        cmd = build_ext(dist)
+        cmd.ext_map['foo/bar'] = ''
+        res = cmd.get_ext_filename('foo')
+        wanted = distutils_build_ext.get_ext_filename(cmd, 'foo')
+        assert res == wanted
+