No new processes needed on IronPython

This commit is contained in:
Thomas Nagy 2016-02-26 18:52:43 +01:00
parent 75e9735a22
commit d131a37ac9
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 2 additions and 2 deletions

View File

@ -831,7 +831,7 @@ def get_process():
return get_process()
def run_process(cmd, kwargs, cargs={}):
if os.name == 'java' or not kwargs.get('stdout', None) or not kwargs.get('stderr', None):
if os.name == 'java' or sys.platform == 'cli' or not kwargs.get('stdout', None) or not kwargs.get('stderr', None):
proc = subprocess.Popen(cmd, **kwargs)
if kwargs.get('stdout', None) or kwargs.get('stderr', None):
out, err = proc.communicate(**cargs)
@ -842,7 +842,7 @@ def run_process(cmd, kwargs, cargs={}):
return status, out, err
else:
proc = get_process()
obj = base64.b64encode(cPickle.dumps([cmd, kwargs, cargs])) #.encode()
obj = base64.b64encode(cPickle.dumps([cmd, kwargs, cargs]))
proc.stdin.write(obj)
proc.stdin.write('\n'.encode())
proc.stdin.flush()