From: Zac Medico Date: Thu, 27 Sep 2007 20:59:42 +0000 (-0000) Subject: Simplify update_eclasses() a little. (trunk r7861) X-Git-Tag: v2.1.3.16~99 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=faa749007a44bc42934506c7be8ad5eeec8d7596;p=portage.git Simplify update_eclasses() a little. (trunk r7861) svn path=/main/branches/2.1.2/; revision=7862 --- diff --git a/pym/eclass_cache.py b/pym/eclass_cache.py index 2915bcf39..ede081d9c 100644 --- a/pym/eclass_cache.py +++ b/pym/eclass_cache.py @@ -42,23 +42,20 @@ class cache: self.eclasses = {} self._eclass_locations = {} eclass_len = len(".eclass") + ignored_listdir_errnos = (errno.ENOENT, errno.ENOTDIR) for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]: - eclass_filenames = [] try: - for y in os.listdir(x): - if y.endswith(".eclass"): - eclass_filenames.append(y) + eclass_filenames = os.listdir(x) except OSError, e: - if e.errno == errno.ENOENT: - del e - continue - elif e.errno == errno.ENOTDIR: + if e.errno in ignored_listdir_errnos: del e continue elif e.errno == PermissionDenied.errno: raise PermissionDenied(x) raise for y in eclass_filenames: + if not y.endswith(".eclass"): + continue try: mtime = long(os.stat(os.path.join(x, y)).st_mtime) except OSError: