1
0
Fork 0
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:
Bruno Binet 2013-01-18 06:39:58 -08:00
commit 370640e008

View file

@ -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