Skip to content

Commit 6a60427

Browse files
committed
changed cache directory creation (for python 2)
1 parent 2efb094 commit 6a60427

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

openml/runs/functions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,8 @@ def get_run(run_id):
641641
run_dir = os.path.join(config.get_cache_directory(), "runs", str(run_id))
642642
run_file = os.path.join(run_dir, "description.xml")
643643

644-
try:
644+
if not os.path.exists(run_dir):
645645
os.makedirs(run_dir)
646-
except FileExistsError:
647-
pass
648646

649647
try:
650648
return _get_cached_run(run_id)

openml/setups/functions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ def get_setup(setup_id):
9090
setup_dir = os.path.join(config.get_cache_directory(), "setups", str(setup_id))
9191
setup_file = os.path.join(setup_dir, "description.xml")
9292

93-
try:
93+
if not os.path.exists(setup_dir):
9494
os.makedirs(setup_dir)
95-
except FileExistsError:
96-
pass
9795

9896
try:
9997
return _get_cached_setup(setup_id)

0 commit comments

Comments
 (0)