Commit 9b301e7a authored by Just van Rossum's avatar Just van Rossum

make sure src exists before creating a symlink

parent 2b59b161
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment