# HG changeset patch # User Matt Mackall # Date 2015-11-09 21:53:11 # Node ID 1aa5083cbebbe7575c88f3402ab377539b484897 # Parent 271a802071b7f52a704f27ca26f5de6d7507ba16 posix: fix test-permissions regression diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -182,14 +182,16 @@ def checklink(path): # link creation might race, try again if inst[0] == errno.EEXIST: continue - # sshfs might report failure while successfully creating the link - if inst[0] == errno.EIO and os.path.exists(name): - os.unlink(name) - return False + raise finally: fd.close() except AttributeError: return False + except OSError as inst: + # sshfs might report failure while successfully creating the link + if inst[0] == errno.EIO and os.path.exists(name): + os.unlink(name) + return False def checkosfilename(path): '''Check that the base-relative path is a valid filename on this platform.