-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-132775: Clean Up Cross-Interpreter Error Handling #135369
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
base: main
Are you sure you want to change the base?
gh-132775: Clean Up Cross-Interpreter Error Handling #135369
Conversation
Python/crossinterp.c
Outdated
}; | ||
if (override != NULL) { | ||
err = *override; | ||
*override = (_PyXI_error_override){0}; |
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.
test_call
passes without the line in my case.
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.
fixed
Python/crossinterp.c
Outdated
if (override == NULL) { | ||
override = &_override; | ||
} | ||
_PyXI_errcode errcode = override->code; |
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.
For test_running
, putting _override.code = errcode;
in the _PyXI_ERR_ALREADY_RUNNING
case (several lines below) works well for me.
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.
fixed
@@ -1485,6 +1491,10 @@ _PyXI_excinfo_Apply(_PyXI_excinfo *info, PyObject *exctype) | |||
if (tbexc == NULL) { | |||
PyErr_Clear(); | |||
} | |||
else { | |||
PyErr_SetObject(exctype, tbexc); | |||
return; |
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.
tbexc
seems to be leaking.
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.
fixed
Thanks for tracking this down! I don't know how you find these things so quickly. 😄
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.
Bisection might be effective using Windows binaries? Not so quick, but even I could be a tester to share the burden.
const char *msg = error->override != NULL | ||
? error->override->msg | ||
: error->uncaught.msg; | ||
_set_xid_lookup_failure(tstate, NULL, msg, cause); |
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.
cause
seems to be leaking.
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.
fixed
Hmm, I forgot to mark this as "draft". Sorry about that. |
In this refactor we:
This change helps simplify several upcoming changes.