From: Eduardo Habkost Date: Fri, 5 Oct 2018 20:40:57 +0000 (-0300) Subject: perf python: Make clang_has_option() work on Python 3 X-Git-Tag: v4.20-rc1~169^2~5^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e13a5d69c31d35538e80176d54d95b6addf4dcbf;p=thirdparty%2Flinux.git perf python: Make clang_has_option() work on Python 3 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 Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/r/20181005204058.7966-2-ehabkost@redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 1942f6dd24f66..261a55e7e1b21 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":