[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 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()