Get a set() of folders from a jottapath (a folder)

def folderlist(jottapath, JFS):
    """Get a set() of folders from a jottapath (a folder)"""
    logging.debug("folderlist %r", jottapath)
    try:
        jf = JFS.getObject(jottapath)
    except JFSNotFoundError:
        return set() # folder does not exist, so pretend it is an empty folder
    if not isinstance(jf, JFSFolder):
        return False
    return set([f.name for f in jf.folders() if not f.is_deleted()])