summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/install_lib.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-05-20 15:08:57 (GMT)
committerGreg Ward <gward@python.net>2000-05-20 15:08:57 (GMT)
commitf355d473fa477ece2c85f54bdcce38114cac4bee (patch)
treebb9cf4edfeb3e5200a78ad323715e7b689eefed4 /Lib/distutils/command/install_lib.py
parent44a61bbb66cfc6a0821d591ccf33fbc209aab112 (diff)
downloadcpython-f355d473fa477ece2c85f54bdcce38114cac4bee.zip
cpython-f355d473fa477ece2c85f54bdcce38114cac4bee.tar.gz
cpython-f355d473fa477ece2c85f54bdcce38114cac4bee.tar.bz2
Check if the claimed build directory doesn't exist, and warn that we don't
have any Python modules to install (rather than bomb when we try to copy a non-existent directory).
Diffstat (limited to 'Lib/distutils/command/install_lib.py')
-rw-r--r--Lib/distutils/command/install_lib.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/distutils/command/install_lib.py b/Lib/distutils/command/install_lib.py
index 63c7a6b..5b3d77a 100644
--- a/Lib/distutils/command/install_lib.py
+++ b/Lib/distutils/command/install_lib.py
@@ -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