]> khamidou — GitHub mirrors - fh.git/commitdiff
fixed the fix ;) master
authorkhamidou <karim@lambda-expr.org>
Fri, 6 Feb 2009 12:40:02 +0000 (13:40 +0100)
committerkhamidou <karim@lambda-expr.org>
Fri, 6 Feb 2009 12:40:02 +0000 (13:40 +0100)
fh-fetch

index 7dbe46c8bbc2a4ad919c4c7c38ad13fb480d399c..0a2b0531cccaaf566601043bbacabb96318298b8 100755 (executable)
--- 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)