From: khamidou Date: Thu, 5 Feb 2009 08:25:34 +0000 (+0100) Subject: Added handling of SIGPIPE X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=207e17f6c01ffa10e27006ed6a50be534d286d98;p=fh.git Added handling of SIGPIPE --- diff --git a/fh-fetch b/fh-fetch index 4f9b0d8..7dbe46c 100755 --- a/fh-fetch +++ b/fh-fetch @@ -6,6 +6,7 @@ import os import sys +import signal import glob import feedparser import time, datetime @@ -80,6 +81,9 @@ def print_field(s): def main(): global to_date, from_date, pattern + # handle gracefully SIGPIPE + signal(signal.SIGPIPE, os.exit) + p = optparse.OptionParser() p.add_option("-t", "--feed-title", action="store", dest="feed_title", help="Show feed title", default=1) p.add_option("-s", "--feed-summary", action="store", dest="feed_summary", help="Show feed summary", default=1)