Skip to content

Commit f3b1969

Browse files
committed
capture stderr for python tool with uv
Signed-off-by: wuhang <wuhang6@huawei.com>
1 parent 1b5b45a commit f3b1969

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gpt_oss/tools/python_docker/docker_tool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def call_python_script_with_uv(script: str) -> str:
7878
exec_result = subprocess.run(
7979
["uv", "run", "--no-project", "python", script_path],
8080
capture_output=True)
81-
return exec_result.stdout.decode("utf-8")
81+
if exec_result.returncode == 0:
82+
return exec_result.stdout.decode("utf-8")
83+
return exec_result.stderr.decode("utf-8")
8284

8385

8486
class PythonTool(Tool):

0 commit comments

Comments
 (0)