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:21:52 +0100 |
commit | ddbeb56f4fb69831453f4b91f5410ba4fde9fa56 (patch) | |
tree | 15a87250b8a1c3bc941abf8b92376d000375610d /bitbake/lib | |
parent | 6dff6392d8286a52d2b3cc921dc3939c8e5cc095 (diff) | |
download | poky-ddbeb56f4fb69831453f4b91f5410ba4fde9fa56.tar.gz |
bitbake: 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]
(Bitbake rev: 148aa1fb45dcb37a756a08301a7daf270e753180)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 9f4067404a..c5fdf6637e 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -182,7 +182,7 @@ def catch_parse_error(func): | |||
182 | parselog.critical(traceback.format_exc()) | 182 | parselog.critical(traceback.format_exc()) |
183 | parselog.critical("Unable to parse %s: %s" % (fn, exc)) | 183 | parselog.critical("Unable to parse %s: %s" % (fn, exc)) |
184 | sys.exit(1) | 184 | sys.exit(1) |
185 | except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: | 185 | except bb.data_smart.ExpansionError as exc: |
186 | import traceback | 186 | import traceback |
187 | 187 | ||
188 | bbdir = os.path.dirname(__file__) + os.sep | 188 | bbdir = os.path.dirname(__file__) + os.sep |
@@ -193,6 +193,8 @@ def catch_parse_error(func): | |||
193 | if not fn.startswith(bbdir): | 193 | if not fn.startswith(bbdir): |
194 | break | 194 | break |
195 | parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb)) | 195 | parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb)) |
196 | except bb.parse.ParseError as exc: | ||
197 | parselog.critical(str(exc)) | ||
196 | sys.exit(1) | 198 | sys.exit(1) |
197 | return wrapped | 199 | return wrapped |
198 | 200 | ||