diff options
author | Rob Austein <sra@hactrn.net> | 2020-07-12 23:14:47 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2020-07-12 23:14:47 -0400 |
commit | 68f48b7e850de48063d95645c3d76e0a2be5c079 (patch) | |
tree | 5f3877cffc7ab83466aea5b7d60d3ad8baae889d | |
parent | 8214b98bf00db2707eca7db9e60099097d032d59 (diff) |
More fun with str and bytes
-rwxr-xr-x | scripts/build-firmware-package.py | 8 |
1 files 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(): |