From a3f722ccc3ff1c545934e616c74916f61ce32638 Mon Sep 17 00:00:00 2001 From: Kit Yan Choi Date: Thu, 28 May 2020 09:42:45 +0100 Subject: [PATCH] Raise exception after reseting exception hooks --- traitsui/tests/_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/traitsui/tests/_tools.py b/traitsui/tests/_tools.py index a46047e3b..a23d4e7b5 100644 --- a/traitsui/tests/_tools.py +++ b/traitsui/tests/_tools.py @@ -60,10 +60,10 @@ def handle_exception(object, trait_name, old, new): traits.trait_notifiers.handle_exception = handle_exception yield finally: - if len(exceptions) > 0: - raise exceptions[0] sys.excepthook = sys.__excepthook__ traits.trait_notifiers.handle_exception = _original_handle_exception + if len(exceptions) > 0: + raise exceptions[0] def _is_current_backend(backend_name=""):