From ed59823ac3fbfe8c8710b858219599b93c8e8a9a Mon Sep 17 00:00:00 2001 From: mw Date: Thu, 5 Sep 2019 21:57:32 +0200 Subject: [PATCH] Fix _resume_screensaver --- bumblebee/modules/caffeine.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bumblebee/modules/caffeine.py b/bumblebee/modules/caffeine.py index 1f39a9e..ed9633c 100644 --- a/bumblebee/modules/caffeine.py +++ b/bumblebee/modules/caffeine.py @@ -67,15 +67,12 @@ class Module(bumblebee.engine.Module): return True def _resume_screensaver(self): - pids = [] success = True xprop_path = bumblebee.util.which('xprop') - for process in psutil.process_iter(): - if process.cmdline() == [xprop_path, '-id', str(self._xid), '-spy']: - pids.append(process.pid) + pids = [ p.pid for p in psutil.process_iter() if p.cmdline() == [xprop_path, '-id', str(self._xid), '-spy'] ] for pid in pids: try: - os.kill(process.pid, 9) + os.kill(pid, 9) except OSError: success = False return success