From 78de479a43466d33050e8573fb264b567dd2d81b Mon Sep 17 00:00:00 2001
From: Valentin Schneider <valentin.schneider@arm.com>
Date: Fri, 19 Oct 2018 18:27:11 +0100
Subject: [PATCH] module/systrace: Fix subprocess interactions for Python 3

Using 'universal_newlines' gives use pure strings instead of byte
strings
---
 devlib/trace/systrace.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/devlib/trace/systrace.py b/devlib/trace/systrace.py
index 72169cb..9e552f4 100644
--- a/devlib/trace/systrace.py
+++ b/devlib/trace/systrace.py
@@ -59,7 +59,9 @@ class SystraceCollector(TraceCollector):
     @property
     @memoized
     def available_categories(self):
-        lines = subprocess.check_output([self.systrace_binary, '-l']).splitlines()
+        lines = subprocess.check_output(
+            [self.systrace_binary, '-l'], universal_newlines=True
+        ).splitlines()
 
         categories = []
         for line in lines:
@@ -139,7 +141,8 @@ class SystraceCollector(TraceCollector):
         self._systrace_process = subprocess.Popen(
             self.systrace_cmd,
             stdin=subprocess.PIPE,
-            shell=True
+            shell=True,
+            universal_newlines=True
         )
 
     def stop(self):