From 1e148cbf9e6ee8ba5f378984b3d491fe00b90532 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 31 Jul 2006 01:51:11 +0000 Subject: [PATCH] Catch ParseError from getconfig during env_update for bug #142157. svn path=/main/trunk/; revision=4050 --- pym/portage.py | 9 +++++---- pym/portage_util.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index b0c6b1102..e2456d280 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -494,10 +494,11 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None): if x[-1]=='~' or x[-4:]==".bak": continue file_path = os.path.join(envd_dir, x) - myconfig = getconfig(file_path) - if myconfig is None: - writemsg("!!! Parsing error in '%s'\n" % file_path, noiselevel=-1) - #parse error + try: + myconfig = getconfig(file_path) + except portage_exception.ParseError, e: + writemsg("!!! %s'\n" % str(e), noiselevel=-1) + del e continue # process PATH, CLASSPATH, LDPATH for myspec in specials.keys(): diff --git a/pym/portage_util.py b/pym/portage_util.py index 7a37d980d..bdd934ec3 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -279,7 +279,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False): except SystemExit, e: raise except Exception, e: - raise e.__class__, str(e)+" in "+mycfg + raise portage_exception.ParseError(str(e)+" in "+mycfg) return mykeys #cache expansions of constant strings -- 2.26.2