summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-01-31 00:59:25 +0000
committerZac Medico <zmedico@gentoo.org>2010-01-31 00:59:25 +0000
commitbfd5fa283e2ba172368ea76c309d8bbc896152a9 (patch)
treea0d33ecc9c2380a6cc6f06c79a99ca1fbf04eaa0
parentd0c0df648967f1d8e9e52e70b3055eb6d670da29 (diff)
downloadportage-bfd5fa283e2ba172368ea76c309d8bbc896152a9.tar.gz
portage-bfd5fa283e2ba172368ea76c309d8bbc896152a9.tar.bz2
portage-bfd5fa283e2ba172368ea76c309d8bbc896152a9.zip
In __iter__, handle OSError from lstat in case a cache entry disappears.
svn path=/main/trunk/; revision=15297
-rw-r--r--pym/portage/cache/flat_hash.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/cache/flat_hash.py b/pym/portage/cache/flat_hash.py
index a010e5061..b014f170d 100644
--- a/pym/portage/cache/flat_hash.py
+++ b/pym/portage/cache/flat_hash.py
@@ -135,7 +135,11 @@ class database(fs_template.FsBased):
if l.endswith(".cpickle"):
continue
p = os.path.join(dir_path, l)
- st = os.lstat(p)
+ try:
+ st = os.lstat(p)
+ except OSError:
+ # Cache entry disappeared.
+ continue
if stat.S_ISDIR(st.st_mode):
# Only recurse 1 deep, in order to avoid iteration over
# entries from another nested cache instance. This can