From b2c84ed80603fa1ed7fbc359770a7acd8dd522e0 Mon Sep 17 00:00:00 2001 From: Stephen Sherratt Date: Tue, 23 May 2017 16:26:15 +1000 Subject: [PATCH] manual: Build system compatible with python3 --- manual/tools/gen_env.py | 5 +++++ manual/tools/gen_invocations.py | 1 + 2 files changed, 6 insertions(+) diff --git a/manual/tools/gen_env.py b/manual/tools/gen_env.py index ef64876ab..9602d39c8 100755 --- a/manual/tools/gen_env.py +++ b/manual/tools/gen_env.py @@ -25,6 +25,11 @@ output_filename = sys.argv[1] p = subprocess.Popen(["git", "log", "-r", "HEAD", "-n", "1", "--pretty=format:%ci"], stdout=subprocess.PIPE) commit_date_string = p.communicate()[0] + +# in python3, this is a bytes, so convert it to a str +if isinstance(commit_date_string, bytes): + commit_date_string = commit_date_string.decode("utf-8") + commit_date = datetime.datetime.strptime(commit_date_string.split()[0], "%Y-%m-%d") # Output in a format that LaTeX can read. diff --git a/manual/tools/gen_invocations.py b/manual/tools/gen_invocations.py index 0b6a51b7c..f20b96855 100755 --- a/manual/tools/gen_invocations.py +++ b/manual/tools/gen_invocations.py @@ -15,6 +15,7 @@ import os import sys import argparse import operator +from functools import reduce from libsel4_tools import syscall_stub_gen # Word size is required by the syscall_stub_gen library, but won't affect the output