[dfsan] Fix build-libc-list.py for Python 3 after D143701
authorFangrui Song <i@maskray.me>
Fri, 10 Feb 2023 18:55:44 +0000 (10:55 -0800)
committerFangrui Song <i@maskray.me>
Fri, 10 Feb 2023 18:55:44 +0000 (10:55 -0800)
compiler-rt/lib/dfsan/scripts/build-libc-list.py

index 5452252..a90649d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #===- lib/dfsan/scripts/build-libc-list.py ---------------------------------===#
 #
 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -44,7 +44,7 @@ def defined_function_list(object):
   functions = []
   readelf_proc = subprocess.Popen(['readelf', '-s', '-W', object],
                                   stdout=subprocess.PIPE)
-  readelf = readelf_proc.communicate()[0].split('\n')
+  readelf = readelf_proc.communicate()[0].decode().split('\n')
   if readelf_proc.returncode != 0:
     raise subprocess.CalledProcessError(readelf_proc.returncode, 'readelf')
   for line in readelf: