shelve: use tryunlink
authorRyan McElroy <rmcelroy@fb.com>
Tue, 21 Mar 2017 06:50:28 -0700
changeset 31543 d5758760c0f4
parent 31542 fad440db3565
child 31544 8a32d6352196
shelve: use tryunlink
hgext/shelve.py
--- a/hgext/shelve.py	Tue Mar 21 06:50:28 2017 -0700
+++ b/hgext/shelve.py	Tue Mar 21 06:50:28 2017 -0700
@@ -236,11 +236,7 @@
             continue
         base = f[:-(1 + len(patchextension))]
         for ext in shelvefileextensions:
-            try:
-                vfs.unlink(base + '.' + ext)
-            except OSError as err:
-                if err.errno != errno.ENOENT:
-                    raise
+            vfs.tryunlink(base + '.' + ext)
 
 def _aborttransaction(repo):
     '''Abort current transaction for shelve/unshelve, but keep dirstate