summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-31 22:46:33 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-31 22:46:33 +0000
commit0a5cb473f87362eec417f6fe1a9297e690a8cbf9 (patch)
tree7fd7cdbbdea959c2633973b484c20b20abf79445 /pym
parentec2ecb3872998ad4e41a190859fd59b04d12fb1b (diff)
downloadportage-0a5cb473f87362eec417f6fe1a9297e690a8cbf9.tar.gz
portage-0a5cb473f87362eec417f6fe1a9297e690a8cbf9.tar.bz2
portage-0a5cb473f87362eec417f6fe1a9297e690a8cbf9.zip
Don't use os.path.isdir() because it can swallow errors related to filesystem/disk corruption.
svn path=/main/trunk/; revision=5852
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index f58af8411..25c676f8e 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5309,8 +5309,14 @@ class vardbapi(dbapi):
def _aux_get(self, mycpv, wants):
mydir = os.path.join(self.root, VDB_PATH, mycpv)
- if not os.path.isdir(mydir):
- raise KeyError(mycpv)
+ try:
+ if not stat.S_ISDIR(os.stat(mydir).st_mode):
+ raise KeyError(mycpv)
+ except OSError, e:
+ if e.errno == errno.ENOENT:
+ raise KeyError(mycpv)
+ del e
+ raise
results = []
for x in wants:
try: