diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-05-07 20:36:02 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-05-07 20:36:02 +0000 |
commit | 475657c7dff3a2879fbc02d58a2231bbf04e2c83 (patch) | |
tree | 3d4f6d23cb60873007f63d6a7f9454eb527423c2 | |
parent | c91e39e76c048d5dd0955a27e9a8c8ce2d557d9b (diff) | |
download | portage-475657c7dff3a2879fbc02d58a2231bbf04e2c83.tar.gz portage-475657c7dff3a2879fbc02d58a2231bbf04e2c83.tar.bz2 portage-475657c7dff3a2879fbc02d58a2231bbf04e2c83.zip |
Fix a potential NameError due to 'cpv' being undefined in the namespace and also fix a potential AttributeError due to an attempt to call reconstruct_eclasses() on a dict object that has already been reconstructed in flat_hash.database._parse_data().
svn path=/main/trunk/; revision=3329
-rw-r--r-- | pym/cache/metadata.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pym/cache/metadata.py b/pym/cache/metadata.py index 1433ad489..1fb19b398 100644 --- a/pym/cache/metadata.py +++ b/pym/cache/metadata.py @@ -3,7 +3,7 @@ # License: GPL2 # $Id: metadata.py 1964 2005-09-03 00:16:16Z ferringb $ -import os, stat +import os, stat, types import flat_hash import cache_errors import eclass_cache @@ -67,8 +67,10 @@ class database(flat_hash.database): if "INHERITED" in d: d["_eclasses_"] = self.ec.get_eclass_data(d["INHERITED"].split(), from_master_only=True) del d["INHERITED"] - else: - d["_eclasses_"] = reconstruct_eclasses(cpv, d["_eclasses_"]) + elif not isinstance(d["_eclasses_"], types.DictType): + # We skip this if flat_hash.database._parse_data() was called above + # because it calls reconstruct_eclasses() internally. + d["_eclasses_"] = reconstruct_eclasses(None, d["_eclasses_"]) return d |