Catch errno.ENOTDIR instead of using os.path.isdir(). (trunk r7770)
authorZac Medico <zmedico@gentoo.org>
Wed, 26 Sep 2007 03:59:10 +0000 (03:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 26 Sep 2007 03:59:10 +0000 (03:59 -0000)
svn path=/main/branches/2.1.2/; revision=7810

pym/eclass_cache.py

index d2ff47f973a4521d234fc903923b051282bd6c41..2915bcf39e6172c0b1e9544286224bed1e1dbc3b 100644 (file)
@@ -43,8 +43,6 @@ class cache:
                self._eclass_locations = {}
                eclass_len = len(".eclass")
                for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]:
-                       if not os.path.isdir(x):
-                               continue
                        eclass_filenames = []
                        try:
                                for y in os.listdir(x):
@@ -54,6 +52,9 @@ class cache:
                                if e.errno == errno.ENOENT:
                                        del e
                                        continue
+                               elif e.errno == errno.ENOTDIR:
+                                       del e
+                                       continue
                                elif e.errno == PermissionDenied.errno:
                                        raise PermissionDenied(x)
                                raise