Fixed valueerror in toGrid

This commit is contained in:
FrederikBaerentsen 2024-12-11 18:48:33 +01:00
parent 0a76f38bb3
commit 9e95a2d75f

View File

@ -66,6 +66,8 @@ def toGrid(input, parser=None):
FileNotFoundError: If the file cannot be found (if input is a file path). FileNotFoundError: If the file cannot be found (if input is a file path).
ValueError: If the parser function is invalid. ValueError: If the parser function is invalid.
""" """
if parser is not None and not callable(parser):
raise ValueError("The parser must be a callable function.")
grid = [] grid = []
try: try: