From 504377d4ddc997bce8165571684729b7b31fccb8 Mon Sep 17 00:00:00 2001 From: Just van Rossum Date: Fri, 17 Jan 2003 20:02:06 +0000 Subject: [PATCH] make sure src exists before creating a symlink --- Lib/plat-mac/bundlebuilder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py index 45642bda1f7..3034ec58141 100755 --- a/Lib/plat-mac/bundlebuilder.py +++ b/Lib/plat-mac/bundlebuilder.py @@ -578,6 +578,8 @@ def makedirs(dir): def symlink(src, dst, mkdirs=0): """Copy a file or a directory.""" + if not os.path.exists(src): + raise IOError, "No such file or directory: '%s'" % src if mkdirs: makedirs(os.path.dirname(dst)) os.symlink(os.path.abspath(src), dst)