From 5fc6f2b77d853eec51d6dbdfbfecc5dd7c5b5648 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 14 May 2011 21:39:26 -0700 Subject: [PATCH] movefile: handle EEXIST when os.symlink fails --- pym/portage/util/movefile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py index f8cc695fb..e07e8ca4f 100644 --- a/pym/portage/util/movefile.py +++ b/pym/portage/util/movefile.py @@ -90,7 +90,8 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, # to tolerate these links being recreated during the merge # process. In any case, if the link is pointing at the right # place, we're in good shape. - if e.errno != errno.ENOENT or target != os.readlink(dest): + if e.errno not in (errno.ENOENT, errno.EEXIST) or \ + target != os.readlink(dest): raise lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) # utime() only works on the target of a symlink, so it's not -- 2.26.2