diff --git a/README.md b/README.md index 152b0f9..d912942 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ you to modify and use the code for the competition. ## Changelog +- **1.2.2:** Previous fix did not work sufficiently. Fixed it now (hopefully). - **1.2.1:** Fixing Issue #2 and a crash when the `type` field is missing. - **1.2.0:** Fixing catching of exception of bad files at the wrong place. Improved error messages. - **1.1.1:** A long on Windows is only 32bit, so changed to using the explicit `int64_t` type. diff --git a/setup.py b/setup.py index 8be4d31..70ec4c2 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def readme(): setup( # https://scikit-build.readthedocs.io/en/latest/usage.html#setup-options name="cgshop2024_pyutils", - version="1.2.1", + version="1.2.2", author="Dominik Krupke", license="LICENSE", description="Utilities for verifying solutions of the CG:SHOP 2024 Competition.", diff --git a/src/cgshop2024_pyutils/io/read.py b/src/cgshop2024_pyutils/io/read.py index 6ec3803..cb69502 100644 --- a/src/cgshop2024_pyutils/io/read.py +++ b/src/cgshop2024_pyutils/io/read.py @@ -47,7 +47,7 @@ def parse_solution(data: typing.Dict): msg = "Solution must be a dictionary. If your JSON-file is a list of solutions, please split it into multiple files." raise BadSolutionFile(msg) # make sure this is a proper solution file - if data.get("type", None).lower() != "cgshop2024_solution": + if not isinstance(data.get("type", None), str) or data["type"].lower() != "cgshop2024_solution": msg = "Not a CGSHOP2024 solution file" raise NoSolution(msg) if "id" in data and "instance" not in data: