From: Zac Medico Date: Wed, 26 Sep 2007 03:59:10 +0000 (-0000) Subject: Catch errno.ENOTDIR instead of using os.path.isdir(). (trunk r7770) X-Git-Tag: v2.1.3.16~136 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7125d9f64ff6f37482bfcd513175431881e3f856;p=portage.git Catch errno.ENOTDIR instead of using os.path.isdir(). (trunk r7770) svn path=/main/branches/2.1.2/; revision=7810 --- diff --git a/pym/eclass_cache.py b/pym/eclass_cache.py index d2ff47f97..2915bcf39 100644 --- a/pym/eclass_cache.py +++ b/pym/eclass_cache.py @@ -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