-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Adjust print_response
to separate error-printing from result display, remove loop
#59218
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
Adjust print_response
to separate error-printing from result display, remove loop
#59218
Conversation
print_response
loop to separate error-printing from result displayprint_response
to separate error-printing from result display, remove loop
The 1 CI failure seemed to be an unrelated timeout or similar, trying to merge/rerun one time before marking for review.... EDIT: All green |
I think I understand |
This would be good for 1.12 backport. Could backport to 1.11 too, though may be a judgment call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Base.sigatomic_end
stuff is some legacy baggage that keeps getting copied here by accident, but the change seems to look right (and work right on my machine in brief testing)
Took a stab at fixing #59209 , but it could be introducing other ways it could fail that I'm not appreciating?
1.11.4 logic:
In no case does the loop execute more than twice.
In 1.11.5+, condition 4 ends up following path 2, and path 4 would only be followed if there's an exception in the scaffolding around the
display
invocations.I restructured it to take out the loop, now it just attempts display if there was no error, accounts for errors during display, and then errors from either response or display are printed.
I'm not sure if I used the
sigatomic_end
calls correctly. EDIT: See comment belowAlso tweaked the final fallback message because it suggests the issue is that the exception per se is a nested type, rather than that printing one exception is triggering another exception. And added a condition to trim REPL frames when it originates from within
print_response
.Fixes #59209