[Bug #414032] Make the 'sdist' command work when the distribution contains
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 10 Aug 2001 20:24:33 +0000 (20:24 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 10 Aug 2001 20:24:33 +0000 (20:24 +0000)
    libraries.  This is done by adding a .get_source_files() method,
    contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker

Lib/distutils/command/build_clib.py

index 063da915524461236db11e850cfedcf08915efeb..69ed0445510d0d086984c1a7de711e28954ee08f 100644 (file)
@@ -184,9 +184,25 @@ class build_clib (Command):
     # get_library_names ()
 
 
-    def build_libraries (self, libraries):
+    def get_source_files (self):
+        self.check_library_list(self.libraries)
+        filenames = []
+        for (lib_name, build_info) in self.libraries:
+            sources = build_info.get('sources')
+            if (sources is None or
+                type(sources) not in (ListType, TupleType) ):
+                raise DistutilsSetupError, \
+                      ("in 'libraries' option (library '%s'), "
+                       "'sources' must be present and must be "
+                       "a list of source filenames") % lib_name
+            
+            filenames.extend(sources)
+
+        return filenames
+    # get_source_files ()
 
-        compiler = self.compiler
+
+    def build_libraries (self, libraries):
 
         for (lib_name, build_info) in libraries:
             sources = build_info.get('sources')