chore: remove redundant pickle import in tool_code.py

This commit is contained in:
CaptainB 2025-07-09 15:00:48 +08:00
parent 693ed6004a
commit e0118f1ce9

View File

@ -46,6 +46,7 @@ class ToolExecutor:
try:
import os
import sys
import pickle
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
sys.path = [p for p in sys.path if p not in path_to_exclude]
sys.path += {python_paths}
@ -61,7 +62,6 @@ try:
for local in locals_v:
globals_v[local] = locals_v[local]
exec_result=f(**keywords)
import pickle
with open({result_path!a}, 'wb') as file:
file.write(pickle.dumps({success}))
except Exception as e: