Skip to content

Fix source code loading example crash#6

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-3651
Draft

Fix source code loading example crash#6
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-3651

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 16, 2026

Bug and impact

  • source/load_mod_from_source_code.py executed a=b in an empty namespace, so running the newly added example crashed immediately with NameError.

Root cause

  • The executed source snippet referenced b without defining it in the supplied namespace.

Fix

  • Make the executed snippet self-contained by assigning a literal value to a.
  • Add a unittest regression that runs the script with runpy and verifies the printed output and exec namespace value.

Validation

  • python3 source/load_mod_from_source_code.py
  • python3 -m unittest discover -s tests -v
Open in Web View Automation 

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