diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-28 18:04:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-29 23:20:40 +0100 |
commit | 148aa1fb45dcb37a756a08301a7daf270e753180 (patch) | |
tree | 624a3ed00da53b1ffce047050d856077da7406be /lib/bb/cookerdata.py | |
parent | c760531c6dbf88135ab9f8e6f0784ccbf2cce1e4 (diff) | |
download | openembedded-core-contrib-148aa1fb45dcb37a756a08301a7daf270e753180.tar.gz |
cookerdata: Improve handling of ParseError
If local.conf contains an invalid line, e.g.:
APPEND += " igor"
(note the leading space) then nasty tracebacks are shown which confuse the
user. Change so the parse error is simply shown without a traceback, improving
the user experience.
[YOCTO #9332]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cookerdata.py')
-rw-r--r-- | lib/bb/cookerdata.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py index 9f4067404a..c5fdf6637e 100644 --- a/lib/bb/cookerdata.py +++ b/lib/bb/cookerdata.py @@ -182,7 +182,7 @@ def catch_parse_error(func): parselog.critical(traceback.format_exc()) parselog.critical("Unable to parse %s: %s" % (fn, exc)) sys.exit(1) - except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: + except bb.data_smart.ExpansionError as exc: import traceback bbdir = os.path.dirname(__file__) + os.sep @@ -193,6 +193,8 @@ def catch_parse_error(func): if not fn.startswith(bbdir): break parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb)) + except bb.parse.ParseError as exc: + parselog.critical(str(exc)) sys.exit(1) return wrapped |