forked from github/pelican
Merge pull request #664 from wking/mkdir-p-nondir-error
utils: Teach mkdir_p to fail if the existing target isn't a directory
This commit is contained in:
commit
370640e008
1 changed files with 1 additions and 1 deletions
|
|
@ -416,5 +416,5 @@ def mkdir_p(path):
|
|||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
if e.errno != errno.EEXIST or not os.path.isdir(path):
|
||||
raise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue