mirror of https://github.com/zeldaret/botw.git
tools: Show line number when CSV parsing fails
This commit is contained in:
parent
7e6fc1d352
commit
a303d6e1b7
|
@ -64,8 +64,12 @@ def get_functions(path: tp.Optional[Path] = None) -> tp.Iterable[FunctionInfo]:
|
||||||
if path is None:
|
if path is None:
|
||||||
path = get_functions_csv_path()
|
path = get_functions_csv_path()
|
||||||
with path.open() as f:
|
with path.open() as f:
|
||||||
for row in csv.reader(f):
|
reader = csv.reader(f)
|
||||||
yield parse_function_csv_entry(row)
|
for row in reader:
|
||||||
|
try:
|
||||||
|
yield parse_function_csv_entry(row)
|
||||||
|
except ValueError as e:
|
||||||
|
raise Exception(f"Failed to parse line {reader.line_num}") from e
|
||||||
|
|
||||||
|
|
||||||
def add_decompiled_functions(new_matches: tp.Dict[int, str],
|
def add_decompiled_functions(new_matches: tp.Dict[int, str],
|
||||||
|
|
Loading…
Reference in New Issue