From 3b8459da37fc8e92061b68b1560dabbe1aac43c9 Mon Sep 17 00:00:00 2001 From: "ak547@uni-freiburg.de" Date: Mon, 15 Oct 2018 11:04:22 +0200 Subject: [PATCH] Fix parallel get_task failing --- openml/tasks/functions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openml/tasks/functions.py b/openml/tasks/functions.py index 2c3532594..48cba0f3c 100644 --- a/openml/tasks/functions.py +++ b/openml/tasks/functions.py @@ -280,14 +280,15 @@ def get_task(task_id): The OpenML task id. """ task_id = int(task_id) - tid_cache_dir = openml.utils._create_cache_directory_for_id( - TASKS_CACHE_DIR_NAME, task_id, - ) with lockutils.external_lock( name='task.functions.get_task:%d' % task_id, lock_path=openml.utils._create_lockfiles_dir(), ): + tid_cache_dir = openml.utils._create_cache_directory_for_id( + TASKS_CACHE_DIR_NAME, task_id, + ) + try: task = _get_task_description(task_id) dataset = get_dataset(task.dataset_id)