From: khamidou Date: Fri, 6 Feb 2009 12:40:02 +0000 (+0100) Subject: fixed the fix ;) X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;ds=sidebyside;p=fh.git fixed the fix ;) --- diff --git a/fh-fetch b/fh-fetch index 7dbe46c..0a2b053 100755 --- a/fh-fetch +++ b/fh-fetch @@ -74,16 +74,16 @@ def parse_date(string): def print_field(s): - sys.stdout.write(s.encode("utf8").replace('\n', '\t').strip()) - sys.stdout.write(sep) + try: + sys.stdout.write(s.encode("utf8").replace('\n', '\t').strip()) + sys.stdout.write(sep) + except IOError: + sys.exit(1) 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)