def _mkdirp(d):
 try:
  os.makedirs(d)
 except OSError as e:
  if (e.errno != errno.EEXIST):
   raise

def _mkdirp ( d ) : try : os . makedirs ( d ) except OSError as e : if ( e . errno != errno . EEXIST ) : raise
ensure directory d exists no guarantee that the directory is writable .