summaryrefslogtreecommitdiff
path: root/src/virtualenv/util/path/_sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/virtualenv/util/path/_sync.py')
-rw-r--r--src/virtualenv/util/path/_sync.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/virtualenv/util/path/_sync.py b/src/virtualenv/util/path/_sync.py
index 860aee1..4c5aa86 100644
--- a/src/virtualenv/util/path/_sync.py
+++ b/src/virtualenv/util/path/_sync.py
@@ -23,6 +23,10 @@ def symlink_or_copy(do_copy, src, dst, relative_symlinks_ok=False):
"""
Try symlinking a target, and if that fails, fall back to copying.
"""
+ if not src.exists():
+ raise RuntimeError("source {} does not exists".format(src))
+ if src == dst:
+ raise RuntimeError("source {} is same as destination ".format(src))
def norm(val):
if IS_PYPY and six.PY3: