Skip to content

Commit

Permalink
Properly detect existence of a symlink.
Browse files Browse the repository at this point in the history
os.path.exists() returns False for broken symlinks.

Reviewed at https://rbcommons.com/s/twitter/r/1437/
  • Loading branch information
benjyw authored and Benjy committed Dec 6, 2014
1 parent baef1d1 commit facaf5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/pants/backend/jvm/ivy_utils.py
Expand Up @@ -383,7 +383,7 @@ def exec_ivy(self,
ivy_args.extend(self._args)

def safe_link(src, dest):
if os.path.exists(dest):
if os.path.islink(dest):
os.unlink(dest)
os.symlink(src, dest)

Expand Down

0 comments on commit facaf5b

Please sign in to comment.