From bcd53f6e4da168a0ee6c61bbf0f683a8a69ea38c Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Sat, 10 Feb 2024 15:47:55 -0600 Subject: [PATCH] Fix bug when registering hooks with execution context --- src/engine/src/owe_python_sdk/runtime/execution_context.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/engine/src/owe_python_sdk/runtime/execution_context.py b/src/engine/src/owe_python_sdk/runtime/execution_context.py index 0c4c758d..416aaec9 100644 --- a/src/engine/src/owe_python_sdk/runtime/execution_context.py +++ b/src/engine/src/owe_python_sdk/runtime/execution_context.py @@ -24,9 +24,7 @@ def add_hook(self, exit_code: int, hook: callable, *args, **kwargs): if not callable(hook): raise TypeError("Error registering hook. Argument 'hook' must be callable") - self._exit_hooks(exit_code, partial(hook, *args, **kwargs)) - - return self + self._exit_hooks[exit_code].append(partial(hook, *args, **kwargs)) def get_input(self, input_id, default=None):