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

Ensure that print reports the correct location in console #3294

Merged
merged 6 commits into from
Oct 5, 2023

Conversation

davep
Copy link
Contributor

@davep davep commented Sep 13, 2023

Fixes #3237

See Textualize/textual-dev#19 for the background to this.

@davep davep marked this pull request as ready for review September 28, 2023 13:07
self._devtools_redirector.write(text)
current_frame = inspect.currentframe()
self._devtools_redirector.write(
text, current_frame.f_back if current_frame is not None else None
Copy link
Contributor

Choose a reason for hiding this comment

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

So, the previous frame is the one where print was called?
Can you briefly explain how a call to print ends up here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you briefly explain how a call to print ends up here?

Not off the top of my head; I don't recall going near that.

@davep davep merged commit 3aaecd3 into Textualize:main Oct 5, 2023
23 checks passed
@davep davep deleted the fix-print-console-location branch October 5, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Textual console showing wrong path
2 participants