Ensures that the private directory exists and is a directory.

    :param str app_name: the name of the app

def ensure_private_dir_exists(app_name):
    """Ensures that the private directory exists and is a directory.

    :param str app_name: the name of the app
    """
    path = private_dir_path(app_name)
    if not os.path.exists(path):
        os.makedirs(path)
    else:
        if not os.path.isdir(path):
            raise PrivateDirConflictError