##// END OF EJS Templates
use Popen command list for ipexec...
MinRK -
Show More
@@ -26,6 +26,7 b' import tempfile'
26 26
27 27 from contextlib import contextmanager
28 28 from io import StringIO
29 from subprocess import Popen, PIPE
29 30
30 31 try:
31 32 # These tools are used by parts of the runtime, so we make the nose
@@ -183,21 +184,22 b' def ipexec(fname, options=None):'
183 184 '--PromptManager.in2_template=""',
184 185 '--PromptManager.out_template=""'
185 186 ]
186 cmdargs = ' '.join(default_argv() + prompt_opts + options)
187 cmdargs = default_argv() + prompt_opts + options
187 188
188 189 _ip = get_ipython()
189 190 test_dir = os.path.dirname(__file__)
190 191
191 192 # FIXME: remove workaround for 2.6 support
192 193 if sys.version_info[:2] > (2,6):
193 ipython_cmd = pipes.quote(sys.executable) + " -m IPython"
194 ipython_cmd = [sys.executable, "-m", "IPython"]
194 195 else:
195 ipython_cmd = "ipython"
196 ipython_cmd = ["ipython"]
196 197 # Absolute path for filename
197 198 full_fname = os.path.join(test_dir, fname)
198 full_cmd = '%s %s %s' % (ipython_cmd, cmdargs, full_fname)
199 #print >> sys.stderr, 'FULL CMD:', full_cmd # dbg
200 out, err = getoutputerror(full_cmd)
199 full_cmd = ipython_cmd + cmdargs + [full_fname]
200 p = Popen(full_cmd, stdout=PIPE, stderr=PIPE)
201 out, err = p.communicate()
202 out, err = py3compat.bytes_to_str(out), py3compat.bytes_to_str(err)
201 203 # `import readline` causes 'ESC[?1034h' to be output sometimes,
202 204 # so strip that out before doing comparisons
203 205 if out:
General Comments 0
You need to be logged in to leave comments. Login now