From 0b5b585992323454f36e89a7c189d4e32b3857fe Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 30 Nov 2012 14:44:05 +0000 Subject: [PATCH] Replace subprocess.call with subprocess.Popen to start deluged from gtk client The use of Popen was originally a fix for a Win32 issue on 1.3 but makes sense to apply to all OSs and simplify code. --- deluge/ui/client.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 3feba4c57..cf9dee85f 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -37,17 +37,13 @@ import logging from twisted.internet.protocol import ClientFactory from twisted.internet import reactor, ssl, defer +import subprocess import deluge.common from deluge import error from deluge.event import known_events from deluge.transfer import DelugeTransferProtocol -if deluge.common.windows_check(): - import win32api -else: - import subprocess - RPC_RESPONSE = 1 RPC_ERROR = 2 RPC_EVENT = 3 @@ -629,12 +625,7 @@ class Client(object): """ try: - if deluge.common.windows_check(): - win32api.WinExec("deluged --port=%s --config=\"%s\"" % (port, config)) - elif deluge.common.osx_check(): - subprocess.call(["nohup", "deluged", "--port=%s" % port, "--config=%s" % config]) - else: - subprocess.call(["deluged", "--port=%s" % port, "--config=%s" % config]) + subprocess.Popen(["deluged", "--port=%s" % port, "--config=%s" % config]) except OSError, e: from errno import ENOENT if e.errno == ENOENT: