# HG changeset patch # User Ryan McElroy # Date 2017-03-21 13:50:28 # Node ID 82b3ec04b652276bb2c799fd42257ffe7ac879bc # Parent 8a32d635219603cc50071f385a9cead0ed82fb70 chgserver: use tryunlink diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -40,7 +40,6 @@ Config from __future__ import absolute_import -import errno import hashlib import inspect import os @@ -543,11 +542,7 @@ class chgunixservicehandler(object): # remove another server's socket file. but that's okay # since that server will detect and exit automatically and # the client will start a new server on demand. - try: - os.unlink(self._realaddress) - except OSError as exc: - if exc.errno != errno.ENOENT: - raise + util.tryunlink(self._realaddress) def printbanner(self, address): # no "listening at" message should be printed to simulate hg behavior