diff options
author | Nathan Binkert <nate@binkert.org> | 2011-01-10 11:11:16 -0800 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2011-01-10 11:11:16 -0800 |
commit | fcc621ac796f824f784ecae2e4335ab183313000 (patch) | |
tree | 911e70232142799098eea2f87c52fb665a7706b9 | |
parent | 3c8cc170d21771f525132ad07e7a4e5d406bdbd2 (diff) | |
download | gem5-fcc621ac796f824f784ecae2e4335ab183313000.tar.xz |
style: prevent the style hook from aborting uncleanly because of an exception
-rw-r--r-- | util/style.py | 16 |
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 _ |