From: Zac Medico Date: Thu, 16 Sep 2010 22:25:23 +0000 (-0700) Subject: Bug #337702 - Fix config.load_best_module() to raise ImportError from X-Git-Tag: v2.2_rc84~32 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=cc799474fb8f6ae476788d3768c4a3b341f3e7e8;p=portage.git 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. --- 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):