bare except'ler çöpe
This commit is contained in:
+3
-10
@@ -36,7 +36,7 @@ def make_com():
|
|||||||
return com
|
return com
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise Error(_("comar package is not fully installed"))
|
raise Error(_("comar package is not fully installed"))
|
||||||
except comar.Error:
|
except comar.CannotConnect:
|
||||||
raise Error(_("cannot connect to comar"))
|
raise Error(_("cannot connect to comar"))
|
||||||
|
|
||||||
def wait_comar():
|
def wait_comar():
|
||||||
@@ -50,11 +50,7 @@ def wait_comar():
|
|||||||
try:
|
try:
|
||||||
sock.connect(sockname)
|
sock.connect(sockname)
|
||||||
return True
|
return True
|
||||||
except KeyboardInterrupt:
|
except socket.error:
|
||||||
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))
|
|
||||||
timeout -= 0.2
|
timeout -= 0.2
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
return False
|
return False
|
||||||
@@ -64,10 +60,7 @@ def wait_for_result(com, package_name=None):
|
|||||||
while 1:
|
while 1:
|
||||||
try:
|
try:
|
||||||
reply = com.read_cmd()
|
reply = com.read_cmd()
|
||||||
except KeyboardInterrupt:
|
except comar.LinkClosed:
|
||||||
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))
|
|
||||||
# Comar postInstall does a "service comar restart" which cuts
|
# Comar postInstall does a "service comar restart" which cuts
|
||||||
# our precious communication link, so we waitsss
|
# our precious communication link, so we waitsss
|
||||||
if package_name == "comar":
|
if package_name == "comar":
|
||||||
|
|||||||
Reference in New Issue
Block a user