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

      break


  return list(reversed(bfs11376))

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




