Mercurial > hg
changeset 30867:aaa751585325
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.
author | Simon Farnsworth <simonfar@fb.com> |
---|---|
date | Thu, 02 Feb 2017 11:17:36 -0800 |
parents | 5249b6470de9 |
children | 847f06179f60 |
files | hgext/pager.py |
diffstat | 1 files changed, 0 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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)