Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the "fake line numbers" hack #39

Merged
merged 4 commits into from
Nov 28, 2024
Merged

Conversation

freider
Copy link
Collaborator

@freider freider commented Nov 28, 2024

Fixes #36

To get real line numbers in a consistent way, we instead insert a number of blank lines in the "exec":ed Python code so we can use default traceback line numbers after that

Also renamed some stuff...

… number from the source file

This is done by inserting blank lines in the Python code that's exec:ed to match
the source file location, letting all of the trace frames use the line number
from the traceback object
@freider freider force-pushed the freider/traceback-line-number-fix branch from a1f8756 to cda677a Compare November 28, 2024 12:30
@freider freider requested a review from kramstrom November 28, 2024 12:42
@freider
Copy link
Collaborator Author

freider commented Nov 28, 2024

@prbot approve

Copy link

@modal-pr-review-automation modal-pr-review-automation bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved 👍. @kramstrom will follow-up review this.

@freider freider merged commit 1cdca80 into main Nov 28, 2024
6 checks passed
@freider freider deleted the freider/traceback-line-number-fix branch November 28, 2024 12:43
Copy link

@kramstrom kramstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥

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.

Tracebacks get confusing when an error happens outside docstring
2 participants