Merge lp:~markhor/light-locker-settings/fix_get_pid_list into lp:light-locker-settings

Proposed by Markhor
Status: Needs review
Proposed branch: lp:~markhor/light-locker-settings/fix_get_pid_list
Merge into: lp:light-locker-settings
Diff against target: 17 lines (+6/-1)
1 file modified
light-locker-settings/light-locker-settings.py (+6/-1)
To merge this branch: bzr merge lp:~markhor/light-locker-settings/fix_get_pid_list
Reviewer Review Type Date Requested Status
Light Locker Settings Team Pending
Review via email: mp+289556@code.launchpad.net

Commit message

Fix work with newer psutil

  Problem:
  https://bbs.archlinux.org/viewtopic.php?id=199003

  Cause:
  https://github.com/giampaolo/psutil/commit/fc8592a482c1232da33366a95ddd62a99130534a

  So psutil >= 2.0.0 breaks light-locker-settings.py

  Solution:
  Try both API variants

Description of the change

Fix work with newer psutil

  Problem:
  https://bbs.archlinux.org/viewtopic.php?id=199003

  Cause:
  https://github.com/giampaolo/psutil/commit/fc8592a482c1232da33366a95ddd62a99130534a

  So psutil >= 2.0.0 breaks light-locker-settings.py

  Solution:
  Try both API variants

To post a comment you must log in.
151. By Markhor

Fix work with newer psutil

  Problem:
  https://bbs.archlinux.org/viewtopic.php?id=199003

  Cause:
  https://github.com/giampaolo/psutil/commit/fc8592a482c1232da33366a95ddd62a99130534a

  So psutil >= 2.0.0 breaks light-locker-settings.py

  Solution:
  Try both API variants

Unmerged revisions

151. By Markhor

Fix work with newer psutil

  Problem:
  https://bbs.archlinux.org/viewtopic.php?id=199003

  Cause:
  https://github.com/giampaolo/psutil/commit/fc8592a482c1232da33366a95ddd62a99130534a

  So psutil >= 2.0.0 breaks light-locker-settings.py

  Solution:
  Try both API variants

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'light-locker-settings/light-locker-settings.py'
--- light-locker-settings/light-locker-settings.py 2015-06-09 17:06:49 +0000
+++ light-locker-settings/light-locker-settings.py 2016-03-19 08:26:11 +0000
@@ -218,7 +218,12 @@
218 def check_running_process(self, process_name):218 def check_running_process(self, process_name):
219 """Return True if the specified process is active."""219 """Return True if the specified process is active."""
220 # Find the process...220 # Find the process...
221 for pid in psutil.get_pid_list():221 try:
222 # since 2.0.0 - 2014-03-10
223 pids = psutil.pids()
224 except AttributeError:
225 pids = psutil.get_pid_list()
226 for pid in pids:
222 try:227 try:
223 p = psutil.Process(pid)228 p = psutil.Process(pid)
224 if self.get_process_username(p) == username:229 if self.get_process_username(p) == username:

Subscribers

People subscribed via source and target branches