From fcc621ac796f824f784ecae2e4335ab183313000 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 10 Jan 2011 11:11:16 -0800 Subject: [PATCH] style: prevent the style hook from aborting uncleanly because of an exception --- util/style.py | 16 ++++++++++++++-- 1 file 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 _ -- 2.30.2