From d3f1e28b113115c6fbbccf928d58bb11b6a5301b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 27 Sep 2007 22:28:56 +0000 Subject: [PATCH] Move prelink tempfile cleanup to the finally block and remove unused locking code. (trunk r7864) svn path=/main/branches/2.1.2/; revision=7865 --- pym/portage_checksum.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pym/portage_checksum.py b/pym/portage_checksum.py index 30b9ca95c..91984fe96 100644 --- a/pym/portage_checksum.py +++ b/pym/portage_checksum.py @@ -13,7 +13,6 @@ import stat import tempfile import portage_exception import portage_exec -import portage_locks import commands import md5, sha @@ -203,7 +202,6 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0): global prelink_capable myfilename = filename[:] prelink_tmpfile = None - mylock = None try: if calc_prelink and prelink_capable: # Create non-prelinked temporary file to checksum. @@ -229,6 +227,8 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0): if e.errno == errno.ENOENT: raise portage_exception.FileNotFound(myfilename) raise + return myhash, mysize + finally: if prelink_tmpfile: try: os.unlink(prelink_tmpfile) @@ -236,10 +236,6 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0): if e.errno != errno.ENOENT: raise del e - return myhash, mysize - finally: - if mylock: - portage_locks.unlockfile(mylock) def perform_multiple_checksums(filename, hashes=["MD5"], calc_prelink=0): """ -- 2.26.2