diff mercurial/server.py @ 31548:ce4ddcda868b

server: use tryunlink
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 21 Mar 2017 06:50:28 -0700
parents ff7df4bb75de
children 2406dbba49bd
line wrap: on
line diff
--- a/mercurial/server.py	Tue Mar 21 06:50:28 2017 -0700
+++ b/mercurial/server.py	Tue Mar 21 06:50:28 2017 -0700
@@ -7,7 +7,6 @@
 
 from __future__ import absolute_import
 
-import errno
 import os
 import sys
 import tempfile
@@ -60,11 +59,7 @@
                 raise error.Abort(_('child process failed to start'))
             writepid(pid)
         finally:
-            try:
-                os.unlink(lockpath)
-            except OSError as e:
-                if e.errno != errno.ENOENT:
-                    raise
+            util.tryunlink(lockpath)
         if parentfn:
             return parentfn(pid)
         else: