]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Only run build_py if we have pure Python modules, and build_ext if we
authorGreg Ward <gward@python.net>
Tue, 21 Sep 1999 18:27:55 +0000 (18:27 +0000)
committerGreg Ward <gward@python.net>
Tue, 21 Sep 1999 18:27:55 +0000 (18:27 +0000)
have extension modules.

Lib/distutils/command/build.py

index 187dddc0b7cd01ee463d42bbc47c049b43f74c8b..b74e51cfea2766eb5bad2c1d3187822b0d05fc12 100644 (file)
@@ -40,10 +40,14 @@ class Build (Command):
         # For now, "build" means "build_py" then "build_ext".  (Eventually
         # it should also build documentation.)
 
-        # Invoke the 'build_py' command
-        self.run_peer ('build_py')
-
-        # And now 'build_ext'
-        self.run_peer ('build_ext')
+        # Invoke the 'build_py' command to "build" pure Python modules
+        # (ie. copy 'em into the build tree)
+        if self.distribution.packages or self.distribution.py_modules:
+            self.run_peer ('build_py')
+
+        # And now 'build_ext' -- compile extension modules and put them
+        # into the build tree
+        if self.distribution.ext_modules:
+            self.run_peer ('build_ext')
 
 # end class Build