From cc799474fb8f6ae476788d3768c4a3b341f3e7e8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 16 Sep 2010 15:25:23 -0700 Subject: Bug #337702 - Fix config.load_best_module() to raise ImportError from the indentation block that caught it. In python3, we get a "RuntimeError: No active exception to reraise" exception if we try to call raise after completion of the indentation block were the last exception was caught. --- pym/portage/package/ebuild/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 7c1060f12..aa8d3c0a1 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -886,14 +886,14 @@ class config(object): try: mod = load_mod(best_mod) except ImportError: - if best_mod.startswith("cache."): + if not best_mod.startswith("cache."): + raise + else: best_mod = "portage." + best_mod try: mod = load_mod(best_mod) except ImportError: - pass - if mod is None: - raise + raise return mod def lock(self): -- cgit v1.2.3-1-g7c22