# HG changeset patch # User Franz Glasner # Date 1746429715 -7200 # Node ID 7044c2900890bfefab8fdf8d74baa5719f366da2 # Parent c19a21180a8fc43bb04b2341b4f7149dab52ccd2 FIX: Convert the ultimate parse errors for a .treesum file into a real ValueError. Do not assert such important runtime errors. BUGS: Should be a dedicated exception type. diff -r c19a21180a8f -r 7044c2900890 cutils/treesum.py --- a/cutils/treesum.py Mon May 05 08:53:35 2025 +0200 +++ b/cutils/treesum.py Mon May 05 09:21:55 2025 +0200 @@ -1870,7 +1870,8 @@ else: return (algo_name, mo.group(2), None, None) else: - assert False, line + raise ValueError( + "Cannot parse line: %r" % (line,)) return line def _get_next_line(self): @@ -1932,7 +1933,9 @@ block_no = 0 for record in reader: if record[0] == "VERSION": - assert record[1] == "1" + if record[1] != "1": + raise ValueError( + "VERSION not yet handled: %r" % (record[1],)) # start a new block in_block = True block_no += 1