From 2225f247a413d8311b903208fff389d3cf77d7d9 Mon Sep 17 00:00:00 2001 From: virgilsisoe <28490646+sisoe24@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:46:03 -0500 Subject: [PATCH] Fix houdini exec with exception --- .../controllers/houdini/scripts/python/app/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nukeserversocket/controllers/houdini/scripts/python/app/main.py b/nukeserversocket/controllers/houdini/scripts/python/app/main.py index e4884687..44c52ad0 100644 --- a/nukeserversocket/controllers/houdini/scripts/python/app/main.py +++ b/nukeserversocket/controllers/houdini/scripts/python/app/main.py @@ -1,6 +1,7 @@ """Nuke-specific plugin for the NukeServerSocket.""" from __future__ import annotations +import traceback from typing import Optional from PySide2.QtWidgets import QWidget @@ -14,7 +15,10 @@ class HoudiniController(BaseController): def execute(self, data: ReceivedData) -> str: with stdoutIO() as s: - exec(data.text, globals()) + try: + exec(data.text, globals()) + except Exception: + return traceback.format_exc() return s.getvalue()