diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-16 14:13:45 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-16 14:13:45 -0700 |
commit | 5b8fdc7d3e4c64ce79d0218fd101f8292602d10b (patch) | |
tree | 8ef92dddf94c3fc01011b0384c82f4b4b4119cf2 /pym/portage/eclass_cache.py | |
parent | EbuildMetadataPhase: avoid redundant EAPI parsing (diff) | |
download | portage-5b8fdc7d3e4c64ce79d0218fd101f8292602d10b.tar.gz portage-5b8fdc7d3e4c64ce79d0218fd101f8292602d10b.tar.bz2 portage-5b8fdc7d3e4c64ce79d0218fd101f8292602d10b.zip |
hashed_path: convert stat OSError to FileNotFound
This makes it consistent with perform_checksum call which also raises
FileNotFound instead of OSError.
Diffstat (limited to 'pym/portage/eclass_cache.py')
-rw-r--r-- | pym/portage/eclass_cache.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pym/portage/eclass_cache.py b/pym/portage/eclass_cache.py index adfe69ae9..4a934f16f 100644 --- a/pym/portage/eclass_cache.py +++ b/pym/portage/eclass_cache.py @@ -9,7 +9,7 @@ import sys import operator from portage.util import normalize_path import errno -from portage.exception import PermissionDenied +from portage.exception import FileNotFound, PermissionDenied from portage import os from portage import checksum @@ -30,7 +30,12 @@ class hashed_path(object): # the straight c api. # thus use the defacto python compatibility work around; # access via index, which guarantees you get the raw long. - self.mtime = obj = os.stat(self.location)[stat.ST_MTIME] + try: + self.mtime = obj = os.stat(self.location)[stat.ST_MTIME] + except OSError as e: + if e.errno in (errno.ENOENT, errno.ESTALE): + raise FileNotFound(self.location) + raise return obj if not attr.islower(): # we don't care to allow .mD5 as an alias for .md5 @@ -113,7 +118,7 @@ class cache(object): obj.eclass_dir = x try: mtime = obj.mtime - except OSError: + except FileNotFound: continue ys=y[:-eclass_len] if x == self._master_eclass_root: |