changeset 31545:82b3ec04b652

chgserver: use tryunlink
author Ryan McElroy <rmcelroy@fb.com>
date Tue, 21 Mar 2017 06:50:28 -0700
parents 8a32d6352196
children b71143b10f74
files mercurial/chgserver.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/chgserver.py	Tue Mar 21 06:50:28 2017 -0700
+++ b/mercurial/chgserver.py	Tue Mar 21 06:50:28 2017 -0700
@@ -40,7 +40,6 @@
 
 from __future__ import absolute_import
 
-import errno
 import hashlib
 import inspect
 import os
@@ -543,11 +542,7 @@
         # 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