changeset 31550:8a32d6352196

bookmarks: use tryunlink
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 21 Mar 2017 06:50:28 -0700
parents d5758760c0f4
children 82b3ec04b652
files mercurial/bookmarks.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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):