summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage_checksum.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pym/portage_checksum.py b/pym/portage_checksum.py
index f837966bc..a11dbc4f6 100644
--- a/pym/portage_checksum.py
+++ b/pym/portage_checksum.py
@@ -6,6 +6,7 @@
from portage_const import PRIVATE_PATH,PRELINK_BINARY,HASHING_BLOCKSIZE
import os
+import errno
import shutil
import stat
import portage_exception
@@ -134,8 +135,13 @@ def perform_checksum(filename, hash_function=md5hash, calc_prelink=0):
myhash, mysize = hash_function(myfilename)
if calc_prelink and prelink_capable:
- if os.path.exists(prelink_tmpfile):
+ try:
os.unlink(prelink_tmpfile)
+ except OSError, oe:
+ if oe.errno == errno.ENOENT:
+ pass
+ else:
+ raise oe
portage_locks.unlockfile(mylock)
return (myhash,mysize)