Skip to content

Commit e3cb9a5

Browse files
compatibility with Windows
An earlier update (likely, 1.1) broke compatibility with Windows when passing the MiniZinc command to the OS. This change fixes is by ensuring that the Windows-specific command line is correct
1 parent 5b57939 commit e3cb9a5

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

core/minizinc_runner.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,18 @@ def _build_command(minizinc_path: str, solver_config: str, model_file: str, data
5757
- On POSIX: [full_command_string]
5858
"""
5959
if solver_config == PathsIni.FILE_ERROR_PLACEHOLDER:
60-
solver_config = ' --solver gecode'
60+
if sys.platform.startswith('win'):
61+
solver_config = ['--solver','gecode']
62+
else:
63+
solver_config = '--solver gecode'
6164
logger.info('Using Gecode, 1 thread')
62-
else:
63-
solver_config = ' --param-file-no-push ' + solver_config
64-
65+
elif sys.platform.startswith('win'):
66+
solver_config = [solver_config]
67+
6568
if sys.platform.startswith('win'):
66-
cmd = [minizinc_path, solver_config, model_file, data_file]
69+
cmd = [minizinc_path] + solver_config + [model_file, data_file]
6770
else:
68-
cmd = [minizinc_path + solver_config + ' ' + model_file + ' ' + data_file]
69-
71+
cmd = [minizinc_path + ' --param-file-no-push ' + solver_config + ' ' + model_file + ' ' + data_file]
7072
return cmd
7173

7274

0 commit comments

Comments
 (0)