from errno import EEXIST
from os.path import split, isdir
from os import makedirs
def bfs11372(path):
  bfs11371 = []
  while True:
    (path, bfs11370) = split(path)
    if (bfs11370 != ''):
      bfs11371.append(bfs11370)
    else:
      if (path != ''):
        bfs11371.append(path)

      break


  return list(reversed(bfs11371))

def bfs11373(path):
  try:
    makedirs(path, exist_ok=True)
  except TypeError:
    try:
      makedirs(path)
    except OSError, bfs11374:
      if ((bfs11374.errno == EEXIST) and isdir(path)):
        pass
      else:
        raise 




