Skip to content

Commit 4e5fa93

Browse files
committed
join args using shlex for linux
1 parent 72caa50 commit 4e5fa93

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

PyStemmusScope/stemmus_scope.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import logging
44
import os
5+
import shlex
56
import subprocess
67
from pathlib import Path
78
from typing import Dict
@@ -165,8 +166,11 @@ def run(self) -> str:
165166
if self.sub_process=="Matlab":
166167
# set Matlab arguments
167168
path_to_config = f"'{self.cfg_file}'"
168-
eval_code= f"STEMMUS_SCOPE_exe({path_to_config});exit;"
169+
eval_code= f'STEMMUS_SCOPE_exe({path_to_config});exit;'
169170
args = ["matlab", "-r", eval_code, "-nodisplay", "-nosplash", "-nodesktop"]
171+
# seperate args dont work on linux!
172+
if utils.os_name !="nt":
173+
args = shlex.join(args)
170174
result = _run_sub_process(args, self.model_src)
171175
if self.sub_process=="Octave":
172176
# set Octave arguments
@@ -177,6 +181,9 @@ def run(self) -> str:
177181
path_to_config = path_to_config.replace("\\", "/")
178182
eval_code = f'STEMMUS_SCOPE_exe({path_to_config});exit;'
179183
args = ["octave", "--eval", eval_code, "--no-gui", "--silent"]
184+
# seperate args dont work on linux!
185+
if utils.os_name !="nt":
186+
args = shlex.join(args)
180187
result = _run_sub_process(args, self.model_src)
181188
return result
182189

0 commit comments

Comments
 (0)