# Buggy code
def process_generate_options(app: Sphinx) -> None:
    genfiles = app.config.autosummary_generate

    if genfiles is True:
        env = app.builder.env
        genfiles = [
            env.doc2path(x, base=None)
            for x in env.found_docs
            if os.path.isfile(env.doc2path(x))
        ]
    else:
        ext = list(app.config.source_suffix)
        genfiles = [
            genfile + (ext[0] if not genfile.endswith(tuple(ext)) else "")
            for genfile in genfiles
        ]

        for entry in genfiles[:]:
            if not path.isfile(path.join(app.srcdir, entry)):
                logger.warning(__("autosummary_generate: file not found: %s"), entry)
                genfiles.remove(entry)

    if not genfiles:
        return

    suffix = get_rst_suffix(app)
    if suffix is None:
        logger.warning(
            __(
                "autosummary generats .rst files internally. "
                "But your source_suffix does not contain .rst. Skipped."
            )
        )
        return

    from sphinx.ext.autosummary.generate import generate_autosummary_docs

    imported_members = app.config.autosummary_imported_members
    with mock(app.config.autosummary_mock_imports):
        generate_autosummary_docs(
            genfiles,
            builder=app.builder,
            suffix=suffix,
            base_path=app.srcdir,
            app=app,
            imported_members=imported_members,
            overwrite=app.config.autosummary_generate_overwrite,
        )


# Traceback (TypeError)
Traceback (most recent call last):
File "/Users/tkomiya/work/sphinx/sphinx/cmd/build.py", line 276, in build_main
app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
File "/Users/tkomiya/work/sphinx/sphinx/application.py", line 277, in __init__
self._init_builder()
File "/Users/tkomiya/work/sphinx/sphinx/application.py", line 333, in _init_builder
self.events.emit('builder-inited')
File "/Users/tkomiya/work/sphinx/sphinx/events.py", line 107, in emit
results.append(listener.handler(self.app, *args))
File "/Users/tkomiya/work/sphinx/sphinx/ext/autosummary/__init__.py", line 727, in process_generate_options
genfiles = [genfile + (ext[0] if not genfile.endswith(tuple(ext)) else '')
TypeError: 'bool' object is not iterable

# Fixed code
def process_generate_options(app: Sphinx) -> None:
    genfiles = app.config.autosummary_generate

    if genfiles is True:
        env = app.builder.env
        genfiles = [
            env.doc2path(x, base=None)
            for x in env.found_docs
            if os.path.isfile(env.doc2path(x))
        ]
    elif genfiles is False:
        pass
    else:
        ext = list(app.config.source_suffix)
        genfiles = [
            genfile + (ext[0] if not genfile.endswith(tuple(ext)) else "")
            for genfile in genfiles
        ]

        for entry in genfiles[:]:
            if not path.isfile(path.join(app.srcdir, entry)):
                logger.warning(__("autosummary_generate: file not found: %s"), entry)
                genfiles.remove(entry)

    if not genfiles:
        return

    suffix = get_rst_suffix(app)
    if suffix is None:
        logger.warning(
            __(
                "autosummary generats .rst files internally. "
                "But your source_suffix does not contain .rst. Skipped."
            )
        )
        return

    from sphinx.ext.autosummary.generate import generate_autosummary_docs

    imported_members = app.config.autosummary_imported_members
    with mock(app.config.autosummary_mock_imports):
        generate_autosummary_docs(
            genfiles,
            builder=app.builder,
            suffix=suffix,
            base_path=app.srcdir,
            app=app,
            imported_members=imported_members,
            overwrite=app.config.autosummary_generate_overwrite,
        )