diff --git a/py/execnet/script/loop_socketserver.py b/py/execnet/script/loop_socketserver.py index a2f399cfa..00d31b349 100644 --- a/py/execnet/script/loop_socketserver.py +++ b/py/execnet/script/loop_socketserver.py @@ -1,12 +1,13 @@ import os, sys +import subprocess if __name__ == '__main__': directory = os.path.dirname(os.path.abspath(sys.argv[0])) script = os.path.join(directory, 'socketserver.py') while 1: - cmd = "python %s %s" % (script, " ".join(sys.argv[1:])) - print "starting subcommand:", cmd - f = os.popen(cmd) - for line in f: - print line, + cmdlist = ["python", script] + cmdlist.extend(sys.argv[1:]) + print "starting subcommand:", " ".join(cmdlist) + process = subprocess.Popen(cmdlist) + process.wait()