use isdir instead of exists in makedirs

This commit is contained in:
Jack O'Connor 2017-03-10 13:10:29 -05:00
parent 6b7f2fa81d
commit 22128cf572
1 changed files with 2 additions and 1 deletions

View File

@ -14,7 +14,8 @@ def makedirs(path):
path exists with non-default permissions. This isn't fixed until 3.4.
Pathlib won't be getting an exist_ok param until 3.5.'''
path = str(path) # compatibility with pathlib
if not os.path.exists(path):
# Use isdir to avoid silently returning if the path exists but isn't a dir.
if not os.path.isdir(path):
os.makedirs(path)