From 6557c4b9df5a071cb1e0a421bfcbfed4c2f5b484 Mon Sep 17 00:00:00 2001 From: Tafelpoot Date: Fri, 28 Nov 2014 17:08:40 +0100 Subject: [PATCH] daemon fix on windows more compact --- lib/daemon.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/daemon.py b/lib/daemon.py index 91411ec7e..965c6b49b 100644 --- a/lib/daemon.py +++ b/lib/daemon.py @@ -36,12 +36,8 @@ DAEMON_PORT=8001 def do_start_daemon(config): import subprocess logfile = open(os.path.join(config.path, 'daemon.log'),'w') - if sys.platform == "win32": - p = subprocess.Popen(["python",__file__], stderr=logfile, stdout=logfile) - print_stderr("starting daemon (PID %d)"%p.pid) - else: - p = subprocess.Popen(["python2",__file__], stderr=logfile, stdout=logfile, close_fds=True) - print_stderr("starting daemon (PID %d)"%p.pid) + p = subprocess.Popen([sys.executable,__file__], stderr=logfile, stdout=logfile, close_fds=(os.name=="posix")) + print_stderr("starting daemon (PID %d)"%p.pid)