Mercurial > hg
diff mercurial/commandserver.py @ 49304:48f1b314056b
py3: catch BrokenPipeError instead of checking errno == EPIPE
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 16:54:58 +0200 |
parents | dfdf85f37215 |
children | 6e749d4abf05 |
line wrap: on
line diff
--- a/mercurial/commandserver.py Tue May 31 04:18:22 2022 +0200 +++ b/mercurial/commandserver.py Tue May 31 16:54:58 2022 +0200 @@ -6,7 +6,6 @@ # GNU General Public License version 2 or any later version. -import errno import gc import os import random @@ -494,9 +493,8 @@ # known exceptions are caught by dispatch. except error.Abort as inst: ui.error(_(b'abort: %s\n') % inst.message) - except IOError as inst: - if inst.errno != errno.EPIPE: - raise + except BrokenPipeError: + pass except KeyboardInterrupt: pass finally: @@ -514,9 +512,8 @@ fin.close() try: fout.close() # implicit flush() may cause another EPIPE - except IOError as inst: - if inst.errno != errno.EPIPE: - raise + except BrokenPipeError: + pass class unixservicehandler: