hermes - 💡(How to fix) Fix Bug: `--list_distributions` CLI flag crashes with TypeError due to name shadowing [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The --list_distributions flag in batch_runner.py is completely broken. Running python batch_runner.py --list_distributions always crashes with TypeError: 'bool' object is not callable.

Error Message

python batch_runner.py --list_distributions

TypeError: 'bool' object is not callable

Root Cause

The main() function parameter list_distributions: bool = False (line 1159) shadows the imported function list_distributions from toolset_distributions (line 51). When the flag is True, the code at line 1228 tries to call the boolean:

# Line 51 — top-level import
from toolset_distributions import (
    list_distributions,   # ← function
    ...
)

# Line 1147 — main() parameter shadows the import
def main(
    ...
    list_distributions: bool = False,   # ← now a bool in this scope
    ...
):

# Line 1222-1228 — calls the bool, not the function
if list_distributions:                   # True
    ...
    all_dists = list_distributions()     # True() → TypeError

Fix Action

Fixed

Code Example

# Line 51 — top-level import
from toolset_distributions import (
    list_distributions,   # ← function
    ...
)

# Line 1147main() parameter shadows the import
def main(
    ...
    list_distributions: bool = False,   # ← now a bool in this scope
    ...
):

# Line 1222-1228 — calls the bool, not the function
if list_distributions:                   # True
    ...
    all_dists = list_distributions()     # True()TypeError

---

python batch_runner.py --list_distributions
# TypeError: 'bool' object is not callable

---

def main(
    ...
    show_distributions: bool = False,   # renamed
    ...
):
    if show_distributions:
        from toolset_distributions import print_distribution_info
        all_dists = list_distributions()   # now references the module-level import
        ...

---

_list_distributions_fn = list_distributions

def main(..., list_distributions: bool = False, ...):
    if list_distributions:
        all_dists = _list_distributions_fn()
RAW_BUFFERClick to expand / collapse

Summary

The --list_distributions flag in batch_runner.py is completely broken. Running python batch_runner.py --list_distributions always crashes with TypeError: 'bool' object is not callable.

Root Cause

The main() function parameter list_distributions: bool = False (line 1159) shadows the imported function list_distributions from toolset_distributions (line 51). When the flag is True, the code at line 1228 tries to call the boolean:

# Line 51 — top-level import
from toolset_distributions import (
    list_distributions,   # ← function
    ...
)

# Line 1147 — main() parameter shadows the import
def main(
    ...
    list_distributions: bool = False,   # ← now a bool in this scope
    ...
):

# Line 1222-1228 — calls the bool, not the function
if list_distributions:                   # True
    ...
    all_dists = list_distributions()     # True() → TypeError

Reproduction

python batch_runner.py --list_distributions
# TypeError: 'bool' object is not callable

Suggested Fix

Rename the CLI parameter to avoid shadowing:

def main(
    ...
    show_distributions: bool = False,   # renamed
    ...
):
    if show_distributions:
        from toolset_distributions import print_distribution_info
        all_dists = list_distributions()   # now references the module-level import
        ...

Or alias the import before main():

_list_distributions_fn = list_distributions

def main(..., list_distributions: bool = False, ...):
    if list_distributions:
        all_dists = _list_distributions_fn()

File

batch_runner.py, lines 51, 1159, 1228

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING