Use the default action for SIGPIPE. trunk

Thu, 24 Jul 2008 22:35:38 -0400

author
Brett Smith <brettcsmith@brettcsmith.org>
date
Thu, 24 Jul 2008 22:35:38 -0400
branch
trunk
changeset 85
ad73f75c9046
parent 84
d78d63cb4c4e
child 86
e02ca4e9bf42

Use the default action for SIGPIPE.

Using Python's built-in handler makes weird error messages for the user,
and there's no reason not to act like every other Unix program in this
regard. This seems particularly true since we're most likely to get
SIGPIPE with dtrx -l, where we won't write things to disk etc.

scripts/dtrx file | annotate | diff | comparison | revisions
--- a/scripts/dtrx	Thu Jul 24 22:15:19 2008 -0400
+++ b/scripts/dtrx	Thu Jul 24 22:35:38 2008 -0400
@@ -991,6 +991,7 @@
     def __init__(self, arguments):
         for signal_num in (signal.SIGINT, signal.SIGTERM):
             signal.signal(signal_num, self.abort)
+        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
         self.parse_options(arguments)
         self.setup_logger()
         self.successes = []

mercurial