Skip to content

Fix duplicated error output#3

Open
dienhoa wants to merge 2 commits intoAnswerDotAI:mainfrom
dienhoa:main
Open

Fix duplicated error output#3
dienhoa wants to merge 2 commits intoAnswerDotAI:mainfrom
dienhoa:main

Conversation

@dienhoa
Copy link
Copy Markdown
Contributor

@dienhoa dienhoa commented May 5, 2026

Currently, because the traceback is built from stderr, in the error case, if we only check for the existence of result.stderr like the current version does, we will print the error twice.

In [2]: print(bad)
[User] error: Expression [1]:1:7: use of unknown declaration 'bad'
print(bad)
      ^~~

(null)
[User] error: Expression [1]:1:7: use of unknown declaration 'bad'
print(bad)
      ^~~
(null)

Note: This new approach with IOHandler doesn’t have a fine-grained execution status. So we could get an error in the future if mojo repl outputs warnings to stderr (it doesn’t seem to be the case right now). I’ve asked about it on the Mojo forum, and will update if they respond with something new: https://forum.modular.com/t/mojo-repl-warnings-and-execution-status/3024

@jph00

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