Browse Source

fix run_ut to work with py3

zhukoff-pavel 1 year ago
parent
commit
d6b6299558
1 changed files with 2 additions and 2 deletions
  1. 2 2
      library/python/cores/__init__.py

+ 2 - 2
library/python/cores/__init__.py

@@ -193,12 +193,12 @@ def resolve_addresses(addresses, symbolizer, binary):
         "--obj",
         binary,
     ]
-    proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,  **({'text': True} if six.PY3 else {}))
     out, err = proc.communicate(input="\n".join(addresses))
     if proc.returncode:
         raise Exception("Symbolizer failed with rc:{}\nstderr: {}".format(proc.returncode, err))
 
-    resolved = filter(None, out.split("\n\n"))
+    resolved = list(filter(None, out.split("\n\n")))
     if len(addresses) != len(resolved):
         raise Exception("llvm-symbolizer can not extract lines from addresses (count mismatch: {}-{})".format(len(addresses), len(resolved)))