Skip to content

Fire 'line' event for first statement of module code - #2127

Open
BCSharp wants to merge 1 commit into
IronLanguages:mainfrom
BCSharp:first-line
Open

BCSharp wants to merge 1 commit into
IronLanguages:mainfrom
BCSharp:first-line

Conversation

@BCSharp

@BCSharp BCSharp commented Oct 31, 2026

Copy link
Copy Markdown
Member

The DLR treats the first sequence point of a lambda as the location of the 'call' trace event and fires no 'line' event for it. Function bodies emit a dedicated entry sequence point, but module, exec and eval code did not, so their first statement never got a 'line' event.

This PR adds the entry sequence point to PythonAst, at the line of the first statement, matching CPython up to 3.9 (3.10 implements PEP 626).

It also updates test_cp24381 to ignore events from the Python-implemented import machinery, which CPython traces as well, and removes its expected-failure marker.

Fixes IronLanguages/main#740 (archived repo)

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.

sys.settrace doesn't trace through modules

1 participant