diff mercurial/dispatch.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 12adf8c695ed
children 3681a47611b8
line wrap: on
line diff
--- a/mercurial/dispatch.py	Tue May 31 04:18:22 2022 +0200
+++ b/mercurial/dispatch.py	Tue May 31 16:54:58 2022 +0200
@@ -290,9 +290,8 @@
                 # maybe pager would quit without consuming all the output, and
                 # SIGPIPE was raised. we cannot print anything in this case.
                 pass
-            except IOError as inst:
-                if inst.errno != errno.EPIPE:
-                    raise
+            except BrokenPipeError:
+                pass
             ret = -1
         finally:
             duration = util.timer() - starttime