[oe-commits] [bitbake] 02/02: cookerdata: Improve handling of ParseError

git at git.openembedded.org git at git.openembedded.org
Tue Mar 29 12:35:10 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit f15f34767ac1a70cf28ba659f6d285ccb63be262
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Mar 28 18:04:10 2016 +0100

    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 at linuxfoundation.org>
---
 lib/bb/cookerdata.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index 9f40674..c5fdf66 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
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list