Skip to content

Commit 30494cf

Browse files
refactor: avoid using temp files in sandbox.
1 parent 390ab83 commit 30494cf

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

apps/common/utils/tool_code.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ def exec_code(self, code_str, keywords):
7171
python_paths = CONFIG.get_sandbox_python_package_paths().split(',')
7272
_exec_code = f"""
7373
try:
74-
import os
75-
import sys
76-
import json
77-
import base64
78-
import builtins
74+
import sys, json, base64, builtins
7975
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
8076
sys.path = [p for p in sys.path if p not in path_to_exclude]
8177
sys.path += {python_paths}

0 commit comments

Comments
 (0)