posix: fix test-permissions regression stable 3.6.1
authorMatt Mackall <mpm@selenic.com>
Mon, 09 Nov 2015 15:53:11 -0600
branchstable
changeset 26889 1aa5083cbebb
parent 26888 271a802071b7
child 26890 db68fc04875c
posix: fix test-permissions regression
mercurial/posix.py
--- a/mercurial/posix.py	Sun Nov 08 01:10:52 2015 +0800
+++ b/mercurial/posix.py	Mon Nov 09 15:53:11 2015 -0600
@@ -182,14 +182,16 @@
                 # 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.