bookmarks: use tryunlink
authorRyan McElroy <rmcelroy@fb.com>
Tue, 21 Mar 2017 06:50:28 -0700
changeset 31544 8a32d6352196
parent 31543 d5758760c0f4
child 31545 82b3ec04b652
bookmarks: use tryunlink
mercurial/bookmarks.py
--- a/mercurial/bookmarks.py	Tue Mar 21 06:50:28 2017 -0700
+++ b/mercurial/bookmarks.py	Tue Mar 21 06:50:28 2017 -0700
@@ -131,11 +131,7 @@
                 finally:
                     f.close()
             else:
-                try:
-                    self._repo.vfs.unlink('bookmarks.current')
-                except OSError as inst:
-                    if inst.errno != errno.ENOENT:
-                        raise
+                self._repo.vfs.tryunlink('bookmarks.current')
         self._aclean = True
 
     def _write(self, fp):