def mkdirs(newdir, mode=511):
 if six.PY3:
  os.makedirs(newdir, mode=mode, exist_ok=True)
 else:
  try:
   os.makedirs(newdir, mode=mode)
  except OSError as exception:
   if (exception.errno != errno.EEXIST):
    raise

def mkdirs ( newdir , mode = 511 ) : if six . PY3 : os . makedirs ( newdir , mode = mode , exist_ok = True ) else : try : os . makedirs ( newdir , mode = mode ) except OSError as exception : if ( exception . errno != errno . EEXIST ) : raise
creates the directory specified by path .