Skip to content

Commit 303f2fd

Browse files
committed
non-pty spawn to treat the command and args
in the same manner as pt_ spawn does
1 parent e800dca commit 303f2fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

metakernel/pexpect.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ def spawn(command, args=[], timeout=30, maxread=2000,
2424
'''
2525
codec_errors = kwargs.get('codec_errors', kwargs.get('errors', 'strict'))
2626
if pty is None:
27-
command = shlex.split(command, posix=os.name == 'posix')
28-
command += args
27+
if args == []:
28+
command = shlex.split(command, posix=os.name == 'posix')
29+
else:
30+
command += args
2931
child = PopenSpawn(command, timeout=timeout, maxread=maxread,
3032
searchwindowsize=searchwindowsize,
3133
logfile=logfile, cwd=cwd, env=env,

0 commit comments

Comments
 (0)