[PATCH 09/12] perf python: Make clang_has_option() work on Python 3

From
Arnaldo Carvalho de Melo <acme@kernel.org>
Date
2018-10-09 00:55:20
Also in
lkml
Reply to
Arnaldo Carvalho de Melo, 2018-10-09
From: Eduardo Habkost <redacted>

Use a bytes literal so it works with Python 3's version of Popen().
Note that the b"..." syntax requires Python 2.6+.

Signed-off-by: Eduardo Habkost <redacted>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <redacted>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <redacted>
Link: http://lkml.kernel.org/r/20181005204058.7966-2-ehabkost@redhat.com (local)
Signed-off-by: Arnaldo Carvalho de Melo <redacted>
---
 tools/perf/util/setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 1942f6dd24f6..261a55e7e1b2 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -5,7 +5,7 @@ from subprocess import Popen, PIPE
 from re import sub
 
 def clang_has_option(option):
-    return [o for o in Popen(['clang', option], stderr=PIPE).stderr.readlines() if "unknown argument" in o] == [ ]
+    return [o for o in Popen(['clang', option], stderr=PIPE).stderr.readlines() if b"unknown argument" in o] == [ ]
 
 cc = getenv("CC")
 if cc == "clang":
-- 
2.14.4
Thread (17 messages) 17 messages, 4 authors, last reply 2018-10-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help