eclass_cache: fix volatile cache DigestException
authorZac Medico <zmedico@gentoo.org>
Mon, 17 Oct 2011 21:42:09 +0000 (14:42 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 17 Oct 2011 21:42:09 +0000 (14:42 -0700)
The deepcopy in catch/volatile.py misbehaved when it tried to copy
attributes like __DEEPCOPY__ that didn't correspond to known functions.

pym/portage/eclass_cache.py

index 77adcd03f6cc9b5e2e1b3fa32d09720e9edef9ff..1044ad02111187d7124ce9deac5ad1e84cd64e6d 100644 (file)
@@ -42,10 +42,10 @@ class hashed_path(object):
                if not attr.islower():
                        # we don't care to allow .mD5 as an alias for .md5
                        raise AttributeError(attr)
-               try:
-                       val = checksum.perform_checksum(self.location, attr.upper())[0]
-               except KeyError:
+               hashname = attr.upper()
+               if hashname not in checksum.hashfunc_map:
                        raise AttributeError(attr)
+               val = checksum.perform_checksum(self.location, hashname)[0]
                setattr(self, attr, val)
                return val