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

      break


  return list(reversed(bfs11366))

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




