]> granicus.if.org Git - python/commitdiff
Check if the claimed build directory doesn't exist, and warn that we don't
authorGreg Ward <gward@python.net>
Sat, 20 May 2000 15:08:57 +0000 (15:08 +0000)
committerGreg Ward <gward@python.net>
Sat, 20 May 2000 15:08:57 +0000 (15:08 +0000)
have any Python modules to install (rather than bomb when we try to copy
a non-existent directory).

Lib/distutils/command/install_lib.py

index 63c7a6bf008f99ca5803caaf02d6eef2213b8ead..5b3d77a3995a9ada48f2247eae7fc385569e517f 100644 (file)
@@ -53,7 +53,12 @@ class install_lib (Command):
         # Install everything: simply dump the entire contents of the build
         # directory to the installation directory (that's the beauty of
         # having a build directory!)
-        outfiles = self.copy_tree (self.build_dir, self.install_dir)
+        if os.path.isdir(self.build_dir):
+            outfiles = self.copy_tree (self.build_dir, self.install_dir)
+        else:
+            self.warn("'%s' does not exist -- no Python modules to install" %
+                      self.build_dir)
+            return
 
         # (Optionally) compile .py to .pyc
         # XXX hey! we can't control whether we optimize or not; that's up