From: Zac Medico Date: Tue, 13 Feb 2007 19:57:44 +0000 (-0000) Subject: Fix broken imports. X-Git-Tag: v2.2_pre1~1708 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=651c575391fd442b3a6f5d33ca05d2ec108cc1c0;p=portage.git Fix broken imports. svn path=/main/trunk/; revision=5963 --- 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