diff --git a/pisi/api.py b/pisi/api.py index 78ccb904..68dfef97 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -497,7 +497,9 @@ def rebuild_db(files=False): # check db schema versions try: pisi.lockeddbshelve.check_dbversion('filesdbversion', pisi.__filesdbversion__, write=False) - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. files = True # exception means the files db version was wrong pisi.lockeddbshelve.init_dbenv(write=True, writeversion=True) destroy(files) # bye bye diff --git a/pisi/comariface.py b/pisi/comariface.py index da4713d1..f0e492c7 100644 --- a/pisi/comariface.py +++ b/pisi/comariface.py @@ -50,7 +50,9 @@ def wait_comar(): else: sock.connect("/var/run/comar.socket") return True - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. timeout -= 0.2 time.sleep(0.2) return False diff --git a/pisi/fetcher.py b/pisi/fetcher.py index 1e99f728..2be7bac5 100644 --- a/pisi/fetcher.py +++ b/pisi/fetcher.py @@ -203,7 +203,9 @@ class Fetcher: try: total_size = int(headers['Content-Length']) + self.exist_size - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. total_size = 0 self._do_grab(fileObj, dest, total_size) diff --git a/pisi/file.py b/pisi/file.py index 1e76e400..81533202 100644 --- a/pisi/file.py +++ b/pisi/file.py @@ -210,7 +210,9 @@ class File: if sign==File.detached: try: sigfilename = File.download(URI(uri + '.sig'), transfer_dir) - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. raise NoSignatureFound(uri) if os.system('gpg --verify ' + sigfilename) != 0: raise InvalidSignature(uri) diff --git a/pisi/operations.py b/pisi/operations.py index cda9085c..fda5e646 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -266,7 +266,9 @@ def is_upgradable(name, ignore_build = False): (version, release, build) = ctx.installdb.get_version(name) try: pkg = ctx.packagedb.get_package(name) - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. return False if ignore_build or (not build) or (not pkg.build): return Version(release) < Version(pkg.release) diff --git a/pisi/pxml/autoxml.py b/pisi/pxml/autoxml.py index 96fe6fd4..dc9e3b7e 100644 --- a/pisi/pxml/autoxml.py +++ b/pisi/pxml/autoxml.py @@ -106,7 +106,9 @@ class LocalText(dict): return 'en' else: return lang[0:2] - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. raise Error(_('LocalText: unable to get either current or default locale')) def errors(self, where = unicode()): @@ -403,7 +405,9 @@ class autoxml(oo.autosuper, oo.autoprop): try: if getattr(self, name) != getattr(other, name): return False - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. return False return True def notequal(self, other): @@ -640,7 +644,9 @@ class autoxml(oo.autosuper, oo.autoprop): if text: try: value = autoxml.basic_cons_map[token_type](text) - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. value = None errs.append(where + ': ' + _('Type mismatch: read text cannot be decoded')) return value diff --git a/pisi/util.py b/pisi/util.py index eb1d9383..d7a8d7a5 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -458,7 +458,9 @@ def sha1_data(data): m = sha.new() m.update(data) return m.hexdigest() - except: + except KeyboardInterrupt: + raise + except Exception, e: #FIXME: what exception could we catch here, replace with that. raise Error(_("Cannot calculate SHA1 hash of given data")) def uncompress(patchFile, compressType="gz", targetDir=None):