Mercurial > public > mercurial-scm > hg
comparison mercurial/chgserver.py @ 31545:82b3ec04b652
chgserver: use tryunlink
author | Ryan McElroy <rmcelroy@fb.com> |
---|---|
date | Tue, 21 Mar 2017 06:50:28 -0700 |
parents | 3f8f53190d6a |
children | 2d11d278279a |
comparison
equal
deleted
inserted
replaced
31544:8a32d6352196 | 31545:82b3ec04b652 |
---|---|
38 skiphash = False | 38 skiphash = False |
39 """ | 39 """ |
40 | 40 |
41 from __future__ import absolute_import | 41 from __future__ import absolute_import |
42 | 42 |
43 import errno | |
44 import hashlib | 43 import hashlib |
45 import inspect | 44 import inspect |
46 import os | 45 import os |
47 import re | 46 import re |
48 import struct | 47 import struct |
541 return | 540 return |
542 # it is possible to have a race condition here that we may | 541 # it is possible to have a race condition here that we may |
543 # remove another server's socket file. but that's okay | 542 # remove another server's socket file. but that's okay |
544 # since that server will detect and exit automatically and | 543 # since that server will detect and exit automatically and |
545 # the client will start a new server on demand. | 544 # the client will start a new server on demand. |
546 try: | 545 util.tryunlink(self._realaddress) |
547 os.unlink(self._realaddress) | |
548 except OSError as exc: | |
549 if exc.errno != errno.ENOENT: | |
550 raise | |
551 | 546 |
552 def printbanner(self, address): | 547 def printbanner(self, address): |
553 # no "listening at" message should be printed to simulate hg behavior | 548 # no "listening at" message should be printed to simulate hg behavior |
554 pass | 549 pass |
555 | 550 |