From 68f48b7e850de48063d95645c3d76e0a2be5c079 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 12 Jul 2020 23:14:47 -0400 Subject: More fun with str and bytes --- scripts/build-firmware-package.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build-firmware-package.py b/scripts/build-firmware-package.py index 1a96fc7..4f078f4 100755 --- a/scripts/build-firmware-package.py +++ b/scripts/build-firmware-package.py @@ -14,10 +14,10 @@ parser.add_argument("firmware", nargs = "+", help = "firmware args = parser.parse_args() tar = tarfile.TarFile.open(fileobj = args.tarfile, mode = "w|gz") -head = subprocess.check_output(("git", "rev-parse", "HEAD")).strip() -time = subprocess.check_output(("git", "show", "-s", "--format=%ct", "HEAD")).strip() +head = subprocess.check_output(("git", "rev-parse", "HEAD")).strip().decode() +time = subprocess.check_output(("git", "show", "-s", "--format=%ct", "HEAD")).strip().decode() commits = dict((path, hash) for hash, path, branch in - (line.split() for line in subprocess.check_output(("git", "submodule", "status")).splitlines())) + (line.decode().split() for line in subprocess.check_output(("git", "submodule", "status")).splitlines())) sha256 = {} for fn in args.firmware: @@ -34,7 +34,7 @@ with tempfile.NamedTemporaryFile() as f: jf = gpg.stdin else: jf = f - json.dump(dict(head = head, time = time, commits = commits, sha256 = sha256), jf, indent = 2) + jf.write(json.dumps(dict(head = head, time = time, commits = commits, sha256 = sha256), indent = 2).encode()) if use_gpg: gpg.stdin.close() if gpg.wait(): -- cgit v1.2.3