From 56da9a1a697337d6f4fde4fdeeb6c97c667330de Mon Sep 17 00:00:00 2001 From: Christian Hammond Date: Sat, 10 Oct 2009 03:36:57 -0700 Subject: Show syntax errors in .reviewboardrc files. If a .reviewboardrc file had a syntax error, we would silently ignore it, which made it hard to debug problems. We now fail on syntax errors and list the error information, including the filename, line number and offset on the line. Patch by Eric Huss --- rbtools/postreview.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rbtools/postreview.py b/rbtools/postreview.py index 8be963a..9c8b31f 100755 --- a/rbtools/postreview.py +++ b/rbtools/postreview.py @@ -2260,8 +2260,9 @@ def load_config_file(filename): if os.path.exists(filename): try: execfile(filename, config) - except: - pass + except SyntaxError, e: + die('Syntax error in config file: %s\n' + 'Line %i offset %i\n' % (filename, e.lineno, e.offset)) return config -- cgit v1.2.3