changeset 16652:2fdd1902ed2d stable

pager: check if signal.SIGPIPE exists We have to check for signal.SIGPIPE before we attempt to set it.
author David Soria Parra <dsp@php.net>
date Sat, 12 May 2012 09:43:12 +0200
parents 9e40bc4c1bde
children ea7bf1d49bce 48b1674ac1e7
files hgext/pager.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/pager.py	Sat May 12 10:02:47 2012 +0200
+++ b/hgext/pager.py	Sat May 12 09:43:12 2012 +0200
@@ -85,10 +85,8 @@
                  (cmd not in ui.configlist('pager', 'ignore') and not attend))):
                 ui.setconfig('ui', 'formatted', ui.formatted())
                 ui.setconfig('ui', 'interactive', False)
-                try:
+                if util.safehasattr(signal, "SIGPIPE"):
                     signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-                except ValueError:
-                    pass
                 _runpager(p)
         return orig(ui, options, cmd, cmdfunc)