# HG changeset patch # User Simon Farnsworth # Date 1486063056 28800 # Node ID aaa75158532500b3c2b2a8cf1fa22fe8100e233d # Parent 5249b6470de9fbb4da7c32506e4560abc9c24751 pager: don't terminate with extreme prejudice on SIGPIPE (BC) The default SIGPIPE handler causes Mercurial to exit immediately, without running any Python cleanup code (except and finally blocks, atexit handlers etc). This creates problems if you want to do something at exit. If we need a different exit code for broken pipe from pager, then we should code that ourselves in Python; this appears to have been cargo-culted from the fork implementation of pager that's no longer used, where it was needed to stop Broken Pipe errors appearing on the user's terminal. diff -r 5249b6470de9 -r aaa751585325 hgext/pager.py --- a/hgext/pager.py Mon Jan 23 10:48:55 2017 -0800 +++ b/hgext/pager.py Thu Feb 02 11:17:36 2017 -0800 @@ -153,8 +153,6 @@ if usepager: ui.setconfig('ui', 'formatted', ui.formatted(), 'pager') ui.setconfig('ui', 'interactive', False, 'pager') - if util.safehasattr(signal, "SIGPIPE"): - signal.signal(signal.SIGPIPE, signal.SIG_DFL) ui._runpager(p) return orig(ui, options, cmd, cmdfunc)