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):