[tor-commits] [stem/master] Fix for prior correction of name_by_pid()

atagar at torproject.org atagar at torproject.org
Mon Sep 8 04:18:35 UTC 2014


commit 11835ff247b43ea2c01ee3f100e655032606b262
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Sep 7 21:20:21 2014 -0700

    Fix for prior correction of name_by_pid()
    
    Oops! Mistook which local the ps call was setting...
    
      File "/usr/lib/python2.7/threading.py", line 504, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/home/atagar/Desktop/arm/arm/util/tracker.py", line 398, in _tor_status_listener
        tor_cmd = system.name_by_pid(tor_pid) if tor_pid else None
      File "/home/atagar/Desktop/arm/stem/util/system.py", line 277, in name_by_pid
        if results and len(results) == 2 and results[0] == 'COMMAND':
      UnboundLocalError: local variable 'results' referenced before assignment
---
 stem/util/system.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stem/util/system.py b/stem/util/system.py
index bcd6c0d..da02843 100644
--- a/stem/util/system.py
+++ b/stem/util/system.py
@@ -272,7 +272,7 @@ def name_by_pid(pid):
     try:
       results = call(GET_NAME_BY_PID_PS % pid)
     except OSError:
-      pass
+      results = None
 
     if results and len(results) == 2 and results[0] == 'COMMAND':
       process_name = results[1].strip()



More information about the tor-commits mailing list