From: Just van Rossum Date: Fri, 17 Jan 2003 20:02:06 +0000 (+0000) Subject: make sure src exists before creating a symlink X-Git-Tag: v2.3c1~2422 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=504377d4ddc997bce8165571684729b7b31fccb8;p=python make sure src exists before creating a symlink --- diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py index 45642bda1f..3034ec5814 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)