From 920a0534b35fd92a77fcd96539524f8b6a415526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Dunand?= Date: Fri, 3 May 2013 15:36:01 +0200 Subject: [PATCH] Catch SyntaxError in check_scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewrap this exception to ISError to avoid threat them as unexpected error. Signed-off-by: Sébastien Luttringer --- installsystems/image.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/installsystems/image.py b/installsystems/image.py index 435fc5b..fcfe5ab 100644 --- a/installsystems/image.py +++ b/installsystems/image.py @@ -577,7 +577,10 @@ class SourceImage(Image): assert(isinstance(fn, unicode)) assert(isinstance(fc, str)) arrow(fn) - compile(fc, fn.encode(locale.getpreferredencoding()), "exec") + try: + compile(fc, fn.encode(locale.getpreferredencoding()), "exec") + except SyntaxError as e: + raise ISError(exception=e) arrowlevel(-1) def run_build(self): -- GitLab