[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Stacktrace when calling is_running with python3



commit 4052c49809dfd6389423d8d1bd8f8792bd9fbde7
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Nov 4 11:35:21 2017 -0700

    Stacktrace when calling is_running with python3
    
    Recent change broke is_running for python3...
    
      ======================================================================
      ERROR: test_is_running_by_name
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/test/require.py", line 58, in wrapped
          return func(self, *args, **kwargs)
        File "/home/atagar/Desktop/stem/test/integ/util/system.py", line 144, in test_is_running_by_name
          self.assertTrue(stem.util.system.is_running(tor_cmd) or stem.util.system.is_running('tor.real'))
        File "/home/atagar/Desktop/stem/stem/util/system.py", line 449, in is_running
          if isinstance(command, (bytes, unicode)):
      NameError: global name 'unicode' is not defined
---
 stem/util/system.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stem/util/system.py b/stem/util/system.py
index 459cde4a..8de186b1 100644
--- a/stem/util/system.py
+++ b/stem/util/system.py
@@ -444,9 +444,9 @@ def is_running(command):
       command_listing = call(secondary_resolver, None)
 
     if command_listing:
-      command_listing = map(str_type.strip, command_listing)
+      command_listing = [c.strip() for c in command_listing]
 
-      if isinstance(command, (bytes, unicode)):
+      if isinstance(command, (bytes, str_type)):
         command = [command]
 
       for cmd in command:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits