Spaces:
BG5
/
Running

BG5 commited on
Commit
bd5ea1d
·
verified ·
1 Parent(s): b61acfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,8 +20,8 @@ def handle_command(command):
20
  # 切换到工作目录
21
  os.chdir(WORKING_DIR)
22
 
23
- # 使用 unshare 执行命令并捕获输出
24
- process = subprocess.Popen(['unshare', '-r', 'bash', '-c', command], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
25
  while True:
26
  output = process.stdout.readline()
27
  if output == '' and process.poll() is not None:
 
20
  # 切换到工作目录
21
  os.chdir(WORKING_DIR)
22
 
23
+ # 执行命令并捕获输出
24
+ process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
25
  while True:
26
  output = process.stdout.readline()
27
  if output == '' and process.poll() is not None: