Skip to content

Commit 77ab46d

Browse files
committed
Avoid duplicate exists/isdir
1 parent 9453fee commit 77ab46d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openml/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ def _create_cache_directory_for_id(key, id_):
305305
Path of the created dataset cache directory.
306306
"""
307307
cache_dir = os.path.join(_create_cache_directory(key), str(id_))
308-
if os.path.exists(cache_dir) and os.path.isdir(cache_dir):
308+
if os.path.isdir(cache_dir):
309309
pass
310-
elif os.path.exists(cache_dir) and not os.path.isdir(cache_dir):
310+
elif os.path.exists(cache_dir):
311311
raise ValueError("%s cache dir exists but is not a directory!" % key)
312312
else:
313313
os.makedirs(cache_dir)

0 commit comments

Comments
 (0)