diff options
-rw-r--r-- | pym/portage/__init__.py | 11 | ||||
-rw-r--r-- | pym/portage/dbapi/porttree.py | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index f79b525ed..191d6d070 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1557,11 +1557,18 @@ class config: def load_best_module(self,property_string): best_mod = best_from_dict(property_string,self.modules,self.module_priority) + mod = None try: mod = load_mod(best_mod) except ImportError: - dump_traceback(red("Error: Failed to import module '%s'") % best_mod, noiselevel=0) - sys.exit(1) + if best_mod.startswith("cache."): + best_mod = "portage." + best_mod + try: + mod = load_mod(best_mod) + except ImportError: + pass + if mod is None: + raise return mod def lock(self): diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index b1177a4a0..86d70416f 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -136,6 +136,9 @@ class portdbapi(dbapi): pass def close_caches(self): + if not hasattr(self, "auxdb"): + # unhandled exception thrown from constructor + return for x in self.auxdb.keys(): self.auxdb[x].sync() self.auxdb.clear() |