summaryrefslogtreecommitdiff
path: root/util/style.py
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-01-10 11:11:16 -0800
committerNathan Binkert <nate@binkert.org>2011-01-10 11:11:16 -0800
commitfcc621ac796f824f784ecae2e4335ab183313000 (patch)
tree911e70232142799098eea2f87c52fb665a7706b9 /util/style.py
parent3c8cc170d21771f525132ad07e7a4e5d406bdbd2 (diff)
downloadgem5-fcc621ac796f824f784ecae2e4335ab183313000.tar.xz
style: prevent the style hook from aborting uncleanly because of an exception
Diffstat (limited to 'util/style.py')
-rw-r--r--util/style.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/util/style.py b/util/style.py
index a039cb432..1018e813c 100644
--- a/util/style.py
+++ b/util/style.py
@@ -341,12 +341,24 @@ def check_hook(hooktype):
def check_style(ui, repo, hooktype, **kwargs):
check_hook(hooktype)
args = {}
- return do_check_style(ui, repo, **args)
+
+ try:
+ return do_check_style(ui, repo, **args)
+ except Exception, e:
+ import traceback
+ traceback.print_exc()
+ return True
def check_format(ui, repo, hooktype, **kwargs):
check_hook(hooktype)
args = {}
- return do_check_format(ui, repo, **args)
+
+ try:
+ return do_check_format(ui, repo, **args)
+ except Exception, e:
+ import traceback
+ traceback.print_exc()
+ return True
try:
from mercurial.i18n import _