[svn r37445] use suprocess module to start socketserver subprocess

--HG--
branch : trunk
This commit is contained in:
hpk 2007-01-27 20:13:17 +01:00
parent 6d403d4573
commit 780e715395
1 changed files with 6 additions and 5 deletions

View File

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