Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,23 @@
from errno import EEXIST
from os import mkdir, curdir
from os.path import split, exists
def mkdirp(path, mode=0777):
head, tail = split(path)
if not tail:
head, tail = split(head)
if head and tail and not exists(head):
try:
mkdirp(head, mode)
except OSError as e:
# be happy if someone already created the path
if e.errno != EEXIST:
raise
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
return
try:
mkdir(path, mode)
except OSError as e:
# be happy if someone already created the path
if e.errno != EEXIST:
raise

View file

@ -0,0 +1,7 @@
def mkdirp(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else: raise

View file

@ -0,0 +1,2 @@
def mkdirp(path):
os.makedirs(path, exist_ok=True)