Skip to content

Fix source-code loading example crash#7

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-78e9
Draft

Fix source-code loading example crash#7
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-78e9

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 17, 2026

Bug and impact

Running source/load_mod_from_source_code.py crashed immediately with NameError: name 'b' is not defined, making the newly added source-loading example unusable.

Root cause

The executed snippet was a=b, but the script passed an empty namespace to exec, so b was never defined.

Fix and validation

  • Made the executed snippet self-contained by assigning the literal value to a.
  • Added a regression test that runs the script with the current Python interpreter and verifies clean output.
  • Validated with:
    • python3 source/load_mod_from_source_code.py
    • python3 -m unittest discover
    • python3 source/unittest_to_io.py
Open in Web View Automation 

cursoragent and others added 2 commits May 17, 2026 11:01
Co-authored-by: 0-coding <0-coding@users.noreply.github.com>
Co-authored-by: 0-coding <0-coding@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant