summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2009-10-10 03:36:57 -0700
committerChristian Hammond <chipx86@chipx86.com>2009-10-10 03:36:57 -0700
commit56da9a1a697337d6f4fde4fdeeb6c97c667330de (patch)
treefb2ad04675e5e3059452e5707ecffde0584fb786
parent8388d68190bb6193157788466de8782fd607488e (diff)
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
-rwxr-xr-xrbtools/postreview.py5
1 files 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