Skip to content

Commit 2ab5780

Browse files
committed
feat: update sys.path to exclude multiple directories in tool_code.py
1 parent 28efdb4 commit 2ab5780

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/common/utils/tool_code.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def exec_code(self, code_str, keywords):
4343
try:
4444
import os
4545
import sys
46-
path_to_exclude = '/opt/py3/lib/python3.11/site-packages'
47-
sys.path = [p for p in sys.path if p != path_to_exclude]
46+
path_to_exclude = ['/opt/py3/lib/python3.11/site-packages', '/opt/maxkb-app/apps']
47+
sys.path = [p for p in sys.path if p not in path_to_exclude]
4848
sys.path.append('/opt/maxkb-app/sandbox/python-packages')
4949
sys.path.append('/opt/maxkb/python-packages')
5050
env = dict(os.environ)

0 commit comments

Comments
 (0)