From: Marc Fiuczynski Date: Mon, 10 Sep 2007 17:05:16 +0000 (+0000) Subject: exit cleanly when kompare is piped to another application and this pipe is closed X-Git-Tag: linux-2.6-22-1~27 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7b6d18215c859b06815d28a2b0f517c9053d9ab1;hp=e67ca015bdeda98b8deae78279d399e7524eb02a;p=linux-2.6.git exit cleanly when kompare is piped to another application and this pipe is closed --- diff --git a/configs/kompare b/configs/kompare index 3d6676f57..9d58a94f5 100755 --- a/configs/kompare +++ b/configs/kompare @@ -5,7 +5,7 @@ # Marc E. Fiuczynski # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: kompare,v 1.5 2006/12/14 05:08:53 mef Exp $ +# $Id: kompare,v 1.6 2006/12/14 19:59:05 mef Exp $ # import sys, re, os @@ -73,7 +73,12 @@ for key in keys: o = old.get(key,None) n = new[key] if n==o and not showall: continue - print "%6s -> %6s : %s" % (newstate.get(o,o),newstate.get(n,n),key) + try: + print "%6s -> %6s : %s" % (newstate.get(o,o),newstate.get(n,n),key) + except IOError, e: + #print e + sys.exit(0) + seen[key] = None # not sure we care about what options have been removed @@ -85,4 +90,8 @@ for key in keys: n = new.get(key,None) o = old[key] if n == o and not showall: continue - print "%6s -> %6s : %s" % (oldstate.get(o,o),oldstate.get(n,n),key) + try: + print "%6s -> %6s : %s" % (oldstate.get(o,o),oldstate.get(n,n),key) + except IOError, e: + #print e + sys.exit(0)