diff options
author | Nagappan <nagapan@gmail.com> | 2010-03-29 23:47:34 -0700 |
---|---|---|
committer | Nagappan <nagapan@gmail.com> | 2010-03-29 23:47:34 -0700 |
commit | 32b704646afd31e9da0de2c1be74bde69c2abece (patch) | |
tree | 552173bb2370c00738ec3b018f6157aa70a8d76d | |
parent | 2c1e6ac098068864389709aa7597856b5e7aa488 (diff) |
Fixes bug 614249
-rw-r--r-- | ldtp/client.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ldtp/client.py b/ldtp/client.py index bf626c7..4a76a16 100644 --- a/ldtp/client.py +++ b/ldtp/client.py @@ -20,6 +20,8 @@ Headers in this file shall remain intact. import os import sys import time +import signal +import traceback import xmlrpclib import subprocess from socket import error as SocketError @@ -44,9 +46,8 @@ class _Method(xmlrpclib._Method): class Transport(xmlrpclib.Transport): def _spawn_daemon(self): - self._daemon = subprocess.Popen( - ['python', '-c', 'import ldtpd; ldtpd.main()'], - close_fds = True) + self._daemon = os.spawnlp(os.P_NOWAIT, 'python', + 'python', '-c', 'import ldtpd; ldtpd.main()') def request(self, host, handler, request_body, verbose=0): try: @@ -71,7 +72,8 @@ class Transport(xmlrpclib.Transport): def kill_daemon(self): try: - self._daemon.kill() + # SIGKILL 9 Term Kill signal + os.kill(self._daemon, 9) except AttributeError: pass |