diff -r ddadb6b0b58e -r ce4ddcda868b mercurial/server.py --- 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: