From 11bb7cb6579d8843fdfd1dadfc55fa5ccc6a4ff1 Mon Sep 17 00:00:00 2001 From: Mike O'Connor Date: Wed, 25 Feb 2009 17:58:41 -0500 Subject: [PATCH] get rid of finally: Signed-off-by: Mike O'Connor --- daklib/binary.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/daklib/binary.py b/daklib/binary.py index 042cd266..a2601a72 100755 --- a/daklib/binary.py +++ b/daklib/binary.py @@ -133,6 +133,8 @@ class Binary(object): rejected = not self.valid_deb() self.__unpack() + result = False + if not rejected and self.tmpdir: cwd = os.getcwd() try: @@ -147,18 +149,17 @@ class Binary(object): data = tarfile.open(os.path.join(self.tmpdir, "data.tar.bz2" ), "r:bz2") if bootstrap_id: - return DBConn().insert_content_paths(bootstrap_id, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) + result = DBConn().insert_content_paths(bootstrap_id, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) else: pkg = deb822.Packages.iter_paragraphs( control.extractfile('./control') ).next() - return DBConn().insert_pending_content_paths(pkg, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) + result = DBConn().insert_pending_content_paths(pkg, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) except: traceback.print_exc() + result = False - return False - - finally: - os.chdir( cwd ) + os.chdir( cwd ) + return result if __name__ == "__main__": Binary( "/srv/ftp.debian.org/queue/accepted/halevt_0.1.3-2_amd64.deb" ).scan_package() -- 2.39.5