From 000f723e913d71007c5734831d5910eb10b09428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Thu, 24 Jun 2010 08:10:39 +0000 Subject: [PATCH] cli: Ignore broken pipe errors BUG:FIXED:13609 --- pisi-cli | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pisi-cli b/pisi-cli index 4a3726e5..b61e106f 100755 --- a/pisi-cli +++ b/pisi-cli @@ -1,6 +1,6 @@ #!/usr/bin/python # -# Copyright (C) 2005 - 2007, TUBITAK/UEKAE +# Copyright (C) 2005 - 2010, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free @@ -11,6 +11,7 @@ # import sys +import errno import locale import traceback import exceptions @@ -47,6 +48,9 @@ def handle_exception(exception, value, tb): show_traceback = True ui.error(_("Unhandled internal exception.\n" "Please file a bug report to .")) + elif isinstance(value, IOError) and value.errno == errno.EPIPE: + # Ignore broken pipe errors + sys.exit(0) else: # For any other exception (possibly Python exceptions) show # the traceback!