Skip to content

Fix source code loading example crash#2

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-inspection-96d9
Draft

Fix source code loading example crash#2
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-inspection-96d9

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 12, 2026

Bug and impact

Running source/load_mod_from_source_code.py crashed immediately with NameError: name 'b' is not defined, so the newly added executable example could not be used successfully.

Root cause

The dynamic source snippet was a=b, but the namespace passed to exec did not define b.

Fix

Changed the snippet to assign the string literal directly (a='b') and added a stdlib unittest regression that executes the script path and verifies the output.

Validation

  • python3 -m unittest -v
  • python3 source/load_mod_from_source_code.py
  • python3 source/unittest_to_io.py
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