bare except'ler çöpe

This commit is contained in:
Gürer Özen
2006-11-02 09:17:37 +00:00
parent 3f89d0bc83
commit 1444c299db
+3 -10
View File
@@ -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":