Migrate to Python 3
Python 2 will not be maintained past April 2020. Fortunately our scripts
require almost no changes to continue working under Python 3.
This patch forces the use of `python3` binary for all `action*` build
targets in GN and updates hashbang directives in our scripts.
Change-Id: Ic34ac547dfe5f85023ddcf4d1a969818f94a72fb
diff --git a/build/image/check_elf.py b/build/image/check_elf.py
index cbc6454..1dc0cec 100644
--- a/build/image/check_elf.py
+++ b/build/image/check_elf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright 2019 The Hafnium Authors.
#
@@ -14,7 +14,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#!/usr/bin/env python
"""Check ELF file for assembly-level regressions.
Objdumps the given ELF file and detects known assembly patterns, checking for
@@ -79,7 +78,7 @@
objdump_stdout = subprocess.check_output([
OBJDUMP, "-d", args.input_elf ])
- objdump_stdout = objdump_stdout.splitlines()
+ objdump_stdout = objdump_stdout.decode("utf-8").splitlines()
check_eret_speculation_barrier(objdump_stdout)