changeset 51427 | 187c5769a629 |
parent 51295 | c8a2fdf5ca37 |
child 51546 | a452807df09b |
child 51607 | 6c39edd1d348 |
--- a/mercurial/util.py Sat Nov 26 12:23:56 2022 +0100 +++ b/mercurial/util.py Wed Jan 17 14:26:58 2024 +0100 @@ -2610,12 +2610,16 @@ pass -def tryunlink(f: bytes) -> None: - """Attempt to remove a file, ignoring FileNotFoundError.""" +def tryunlink(f: bytes) -> bool: + """Attempt to remove a file, ignoring FileNotFoundError. + + Returns False in case the file did not exit, True otherwise + """ try: unlink(f) + return True except FileNotFoundError: - pass + return False def makedirs(