From 6f4999cb54432cf890fcefea3f8dd1cef3f5e176 Mon Sep 17 00:00:00 2001 From: Marko Semet Date: Sat, 8 Feb 2020 19:53:39 +0100 Subject: [PATCH] Fix typeing --- hash_modules.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hash_modules.py b/hash_modules.py index 128cf7f..e6f2025 100755 --- a/hash_modules.py +++ b/hash_modules.py @@ -42,7 +42,7 @@ def commit_hashes(name, use_local=False, verbose=False): out = out.splitlines()[0] for i in filter(lambda x: not(b"a"[0] <= x <= b"z"[0] or b"0"[0] <= x <= b"9"[0]), out): raise ValueError("Wrong char: " + repr(bytes([i]))) - result.append(out.decode()) + result.append(out) if verbose: if use_local: print("Commit local hashes for " + name + ": " + ", ".join(result), file=sys.stderr) @@ -227,6 +227,8 @@ def get_own_hash(source, arch, use_local=False, verbose=False): tmp = mod.version_hashes(arch, use_local=use_local, verbose=verbose) if len(tmp) != 1: raise ValueError("No unique version number possible.") + if not isinstance(tmp[0], str): + raise ValueError("Result have to be an string.") return tmp[0]