From 32260b50a77b5b5d29b9d9e2bea2e4e6ed8d57ef Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Sun, 3 Nov 2024 18:02:19 +0100 Subject: [PATCH] [Fix] Replace finally statement by except BaseException to suppress all exceptions Co-authored-by: Irit Katriel --- autograd/wrap_util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autograd/wrap_util.py b/autograd/wrap_util.py index 105999ed..9345284a 100644 --- a/autograd/wrap_util.py +++ b/autograd/wrap_util.py @@ -32,6 +32,8 @@ def _wraps(f): try: f.__name__ = namestr.format(fun=get_name(fun), **kwargs) f.__doc__ = docstr.format(fun=get_name(fun), doc=get_doc(fun), **kwargs) + except BaseException: + pass finally: return f