mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
utils: Teach mkdir_p to fail if the existing target isn't a directory
Existing symlinks to directories will still pass, because isdir() follows symbolic links.
This commit is contained in:
parent
08a5ea6fdf
commit
c3c3037a1d
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