From: Zac Medico Date: Mon, 17 Oct 2011 03:03:25 +0000 (-0700) Subject: perform_checksum: OSerror to PermissionDenied X-Git-Tag: v2.2.0_alpha68~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5e2982d998ac5683612de4a776f92a0887a8839d;p=portage.git perform_checksum: OSerror to PermissionDenied --- diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 9f3d81cff..e0bff2ada 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -284,8 +284,10 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0): " hash function not available (needs dev-python/pycrypto)") myhash, mysize = hashfunc_map[hashname](myfilename) except (OSError, IOError) as e: - if e.errno == errno.ENOENT: + if e.errno in (errno.ENOENT, errno.ESTALE): raise portage.exception.FileNotFound(myfilename) + elif e.errno == portage.exception.PermissionDenied.errno: + raise portage.exception.PermissionDenied(myfilename) raise return myhash, mysize finally: