From 9e95a2d75f93c87e39495990141e6346dc95d98e Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Wed, 11 Dec 2024 18:48:33 +0100 Subject: [PATCH] Fixed valueerror in toGrid --- fred.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fred.py b/fred.py index 3112599..d4ad47e 100644 --- a/fred.py +++ b/fred.py @@ -66,6 +66,8 @@ def toGrid(input, parser=None): FileNotFoundError: If the file cannot be found (if input is a file path). 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 = [] try: