def makedirs(path):
    """
    Make all of the directories in the ``path`` using `os.makedirs`.
    """
    if os.path.exists(path):
        if not os.path.isdir(path):
            # If it's not a directory, we can't do anything.
            # This is a problem
            raise RuntimeError('%s already exists and is not a directory.'
                               % path)
    else:
        os.makedirs(path)
def makedirs ( path ) : if os . path . exists ( path ) : if not os . path . isdir ( path ) : raise RuntimeError ( '%s already exists and is not a directory.' % path ) else : os . makedirs ( path )
Make all of the directories in the ``path`` using `os.makedirs`.