pager: check if signal.SIGPIPE exists stable
authorDavid Soria Parra <dsp@php.net>
Sat, 12 May 2012 09:43:12 +0200
branchstable
changeset 16652 2fdd1902ed2d
parent 16651 9e40bc4c1bde
child 16662 ea7bf1d49bce
child 16678 48b1674ac1e7
pager: check if signal.SIGPIPE exists We have to check for signal.SIGPIPE before we attempt to set it.
hgext/pager.py
--- 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)