From 7f3553fb8dd4a42d6b52ed07857bd1f9a445c01a Mon Sep 17 00:00:00 2001 From: Nikita Ostrovsky Date: Wed, 12 Feb 2025 17:48:06 +0000 Subject: [PATCH] CHORE: address edge case where file attribute exists but is None. This occurs when running ARENA running on Colab. --- src/inspect_ai/_eval/registry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inspect_ai/_eval/registry.py b/src/inspect_ai/_eval/registry.py index c33a35a38..d10fee241 100644 --- a/src/inspect_ai/_eval/registry.py +++ b/src/inspect_ai/_eval/registry.py @@ -148,7 +148,7 @@ def wrapper(*w_args: Any, **w_kwargs: Any) -> Task: # module import, so set its task file and run dir if get_installed_package_name(task_type) is None: module = inspect.getmodule(task_type) - if module and hasattr(module, "__file__"): + if module and hasattr(module, "__file__") and module.__file__: file = Path(getattr(module, "__file__")) setattr(task_instance, TASK_FILE_ATTR, file.as_posix()) setattr(task_instance, TASK_RUN_DIR_ATTR, file.parent.as_posix())