From: Chris Larson Date: Fri, 6 May 2011 14:15:34 +0000 (-0700) Subject: cooker: don't show a useless traceback for SyntaxError X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e12105474017262d176dbaaecdc3f90f155aa8df;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git cooker: don't show a useless traceback for SyntaxError Note: we rely on the fact that better_compile has already output information about the exception, so don't do it ourselves. (Bitbake rev: caf21e9fbf3c526c1d7c555d8c76dca8710f9def) Signed-off-by: Chris Larson Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 293ad355b8d..f4836509ca2 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1227,7 +1227,10 @@ class CookerParser(object): self.shutdown(clean=False) bb.fatal('Error parsing %s: %s' % (exc.recipe, bb.exceptions.to_string(exc.realexception))) - except Exception: + except SyntaxError as exc: + logger.error('Unable to parse %s', exc.recipe) + sys.exit(1) + except Exception as exc: import traceback etype, value, tb = sys.exc_info() formatted = bb.exceptions.format_extracted(value.traceback, limit=5)