From 651c575391fd442b3a6f5d33ca05d2ec108cc1c0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 13 Feb 2007 19:57:44 +0000 Subject: [PATCH] Fix broken imports. svn path=/main/trunk/; revision=5963 --- pym/portage/elog/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py index 5ba49793d..c6f6ec47c 100644 --- a/pym/portage/elog/__init__.py +++ b/pym/portage/elog/__init__.py @@ -80,8 +80,10 @@ def elog_process(cpv, mysettings): try: # FIXME: ugly ad.hoc import code # TODO: implement a common portage module loader - logmodule = __import__("portage.elog.mod_"+s) - m = getattr(logmodule, "mod_"+s) + name = "portage.elog.mod_" + s + m = __import__(name) + for comp in name.split(".")[1:]: + m = getattr(m, comp) def timeout_handler(signum, frame): raise PortageException("Timeout in elog_process for system '%s'" % s) import signal @@ -100,7 +102,7 @@ def elog_process(cpv, mysettings): writemsg("!!! Error while importing logging modules " + \ "while loading \"mod_%s\":\n" % str(s)) writemsg("%s\n" % str(e), noiselevel=-1) - except portage.exception.PortageException, e: + except PortageException, e: writemsg("%s\n" % str(e), noiselevel=-1) # clean logfiles to avoid repetitions -- 2.26.2