mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != errno.EEXIST:
|
if e.errno != errno.EEXIST or not os.path.isdir(path):
|
||||||
raise
|
raise
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue