chore: remove redundant pickle import in tool_code.py
parent
693ed6004a
commit
e0118f1ce9
|
|
@ -46,6 +46,7 @@ class ToolExecutor:
|
||||||
try:
|
try:
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import pickle
|
||||||
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
|
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 = [p for p in sys.path if p not in path_to_exclude]
|
||||||
sys.path += {python_paths}
|
sys.path += {python_paths}
|
||||||
|
|
@ -61,7 +62,6 @@ try:
|
||||||
for local in locals_v:
|
for local in locals_v:
|
||||||
globals_v[local] = locals_v[local]
|
globals_v[local] = locals_v[local]
|
||||||
exec_result=f(**keywords)
|
exec_result=f(**keywords)
|
||||||
import pickle
|
|
||||||
with open({result_path!a}, 'wb') as file:
|
with open({result_path!a}, 'wb') as file:
|
||||||
file.write(pickle.dumps({success}))
|
file.write(pickle.dumps({success}))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue