diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-02-01 20:22:16 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-02-01 20:22:16 +0000 |
commit | c9e632d62383d028f5277456fec0c5079ed8ffb8 (patch) | |
tree | baa8f973e8eff441e71c4f60614afd6fa3563008 | |
parent | Load the most current variables from /etc/profile.env for post_emerge stuff. ... (diff) | |
download | portage-2.1.2-r6.tar.gz portage-2.1.2-r6.tar.bz2 portage-2.1.2-r6.zip |
Don't use os.path.isdir() because it can swallow errors related to filesystem/disk corruption. (trunk r5851:5852)v2.1.2-r6
svn path=/main/branches/2.1.2/; revision=5869
-rw-r--r-- | pym/portage.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py index b7ba73f37..25c4d7a14 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5271,8 +5271,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: |