Skip to content

Commit e0118f1

Browse files
committed
chore: remove redundant pickle import in tool_code.py
1 parent 693ed60 commit e0118f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/common/utils/tool_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def exec_code(self, code_str, keywords):
4646
try:
4747
import os
4848
import sys
49+
import pickle
4950
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
5051
sys.path = [p for p in sys.path if p not in path_to_exclude]
5152
sys.path += {python_paths}
@@ -61,7 +62,6 @@ def exec_code(self, code_str, keywords):
6162
for local in locals_v:
6263
globals_v[local] = locals_v[local]
6364
exec_result=f(**keywords)
64-
import pickle
6565
with open({result_path!a}, 'wb') as file:
6666
file.write(pickle.dumps({success}))
6767
except Exception as e:

0 commit comments

Comments
 (0)