]> granicus.if.org Git - python/commitdiff
make sure src exists before creating a symlink
authorJust van Rossum <just@letterror.com>
Fri, 17 Jan 2003 20:02:06 +0000 (20:02 +0000)
committerJust van Rossum <just@letterror.com>
Fri, 17 Jan 2003 20:02:06 +0000 (20:02 +0000)
Lib/plat-mac/bundlebuilder.py

index 45642bda1f742fc3b705020b3ccf8d098a541d59..3034ec581414d7bfcfe62a4456dba82856107ef5 100755 (executable)
@@ -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)