From caf21e9fbf3c526c1d7c555d8c76dca8710f9def Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Fri, 6 May 2011 07:15:34 -0700 Subject: [PATCH] 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. Signed-off-by: Chris Larson --- lib/bb/cooker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 1a1313c326c..01e6c160b60 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -1127,7 +1127,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) -- 2.47.3