Don't use os.path.isdir() because it can swallow errors related to filesystem/disk... v2.1.2-r6
authorZac Medico <zmedico@gentoo.org>
Thu, 1 Feb 2007 20:22:16 +0000 (20:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 1 Feb 2007 20:22:16 +0000 (20:22 -0000)
svn path=/main/branches/2.1.2/; revision=5869

pym/portage.py

index b7ba73f37274b6135099c671ff24adb36e8af353..25c4d7a14484f3e41c44dbe80376f1241adaf4fd 100644 (file)
@@ -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: