From 1444c299db859e56fb6e482f6994ed204412f021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrer=20=C3=96zen?= Date: Thu, 2 Nov 2006 09:17:37 +0000 Subject: [PATCH] =?UTF-8?q?bare=20except'ler=20=C3=A7=C3=B6pe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/comariface.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pisi/comariface.py b/pisi/comariface.py index adce9eee..e79b1003 100644 --- a/pisi/comariface.py +++ b/pisi/comariface.py @@ -36,7 +36,7 @@ def make_com(): return com except ImportError: raise Error(_("comar package is not fully installed")) - except comar.Error: + except comar.CannotConnect: raise Error(_("cannot connect to comar")) def wait_comar(): @@ -50,11 +50,7 @@ def wait_comar(): try: sock.connect(sockname) return True - except KeyboardInterrupt: - raise - except Exception, e: #FIXME: what exception could we catch here, replace with that. - # DEBUG: remove before release - ctx.ui.info("COMARDEBUG: trying to connect '%s', but got %s: %s" % (sockname, e.__class__, e)) + except socket.error: timeout -= 0.2 time.sleep(0.2) return False @@ -64,10 +60,7 @@ def wait_for_result(com, package_name=None): while 1: try: reply = com.read_cmd() - except KeyboardInterrupt: - raise - except Exception, e: #FIXME: what exception could we catch here, replace with that. - ctx.ui.info("COMARDEBUG: waiting reply, but got %s: %s" % (e.__class__, e)) + except comar.LinkClosed: # Comar postInstall does a "service comar restart" which cuts # our precious communication link, so we waitsss if package_name == "comar":