Fix typeing

master
Marko Semet 2020-02-08 19:53:39 +01:00
parent 35a8c97317
commit 6f4999cb54
1 changed files with 3 additions and 1 deletions

View File

@ -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]