33import json
44import subprocess
55from string import Template
6+ import shlex
67
78DEFAULT_LAYOUT = {"cols" : [0.0 , 1.0 ], "rows" : [0.0 , 1.0 ], "cells" : [[0 , 0 , 1 , 1 ]]}
89IO_PANE_LAYOUT = {"cols" : [0.0 , 0.5 , 1.0 ], "rows" : [0.0 , 0.75 , 0.75 , 1.0 ],
@@ -79,15 +80,15 @@ def compile(output_view):
7980 code_file_path = Environment .file_path , code_file = Environment .file )
8081
8182 output_view .run_command ("output_file_edit" , {"append" : "Compiling ...\n " });
82- compile = subprocess .Popen (compile_command ,
83- shell = True ,
83+ compile = subprocess .Popen (shlex . split ( compile_command ) ,
84+ # shell=True,
8485 stdin = subprocess .PIPE ,
8586 stdout = subprocess .PIPE ,
8687 stderr = subprocess .STDOUT ,
8788 universal_newlines = True
8889 )
89- compile .wait ();
90- output_view .run_command ("output_file_edit" , {"append" : compile .args + "\n \n " });
90+ print ( type ( compile .args ))
91+ output_view .run_command ("output_file_edit" , {"append" : '' . join ( compile .args ) + "\n \n " });
9192 output , errors = compile .communicate ()
9293 output_view .run_command ("output_file_edit" , {"append" : "\n " + output + "\n \n " });
9394 output_view .run_command ("output_file_edit" ,
@@ -108,14 +109,14 @@ def execute(input_view, output_view):
108109 code_file_path = Environment .file_path , code_file = Environment .file )
109110
110111 output_view .run_command ("output_file_edit" , {"append" : "Running ...\n " });
111- run = subprocess .Popen (execute_command ,
112- shell = True ,
112+ run = subprocess .Popen (shlex . split ( execute_command ) ,
113+ # shell=True,
113114 stdin = subprocess .PIPE ,
114115 stdout = subprocess .PIPE ,
115116 stderr = subprocess .STDOUT ,
116117 universal_newlines = True
117118 )
118- output_view .run_command ("output_file_edit" , {"append" : run .args + "\n \n " });
119+ output_view .run_command ("output_file_edit" , {"append" : '' . join ( run .args ) + "\n \n " });
119120 output = None
120121 timeout = DEFAULT_TIMEOUT
121122 if "timeout" in lang_settings :
0 commit comments