[Pkg-privacy-commits] [torbrowser-launcher] 101/476: made #17 work with old versions of psutils as well, like what comes with debian squeeze

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.

commit bf84ed52076453b6a3f3448e7a13411f66fca09c
Author: Micah Lee <micahflee at riseup.net>
Date:   Tue Apr 9 09:47:54 2013 -0700

    made #17 work with old versions of psutils as well, like what comes with debian squeeze
---
 torbrowser-launcher | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/torbrowser-launcher b/torbrowser-launcher
index 8f57cd5..5722eb2 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -67,10 +67,21 @@ class TorBrowserLauncher:
                     firefox_pid = None
                     for p in psutil.process_iter():
                         try:
-                            if p.exe == self.paths['file']['vidalia_bin']:
+                            exe = None
+
+                            # old versions of psutil don't have exe
+                            if hasattr(p, 'exe'):
+                                exe = p.exe
+                            # need to rely on cmdline instead
+                            else:
+                                if len(p.cmdline) > 0:
+                                    exe = p.cmdline[0]
+                            
+                            if exe == self.paths['file']['vidalia_bin'] or exe == './App/vidalia':
                                 vidalia_pid = p.pid
-                            if p.exe == self.paths['file']['firefox_bin']:
+                            if exe == self.paths['file']['firefox_bin']:
                                 firefox_pid = p.pid
+
                         except:
                             pass
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list