From 0c7cec519e3fc5e29671d443f883ea1ab8dc7d60 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 14 Mar 2014 00:11:58 +0100 Subject: fix polling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blueshift-tray.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blueshift-tray.py b/src/blueshift-tray.py index c611fc8..97cc75e 100755 --- a/src/blueshift-tray.py +++ b/src/blueshift-tray.py @@ -62,7 +62,7 @@ def term(count = 1, kill = False): process.send_signal(signal.SIGTERM) if count > 1: for i in range(count - 1): - if process.poll(): + if process.poll() is None: time.sleep(0.1) process.send_signal(signal.SIGTERM) if kill: @@ -175,6 +175,6 @@ finally: except KeyboardInterrupt: term() -if process.poll(): +if process.poll() is None: process.send_signal(signal.KILL) -- cgit v1.2.3-70-g09d2