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

[3.9] bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822) #26831

Merged
merged 1 commit into from Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1 @@
Fix ltrace functionality when exceptions are raised. Patch by Pablo Galindo
3 changes: 3 additions & 0 deletions Python/ceval.c
Expand Up @@ -4598,11 +4598,14 @@ static int
prtrace(PyThreadState *tstate, PyObject *v, const char *str)
{
printf("%s ", str);
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
if (PyObject_Print(v, stdout, 0) != 0) {
/* Don't know what else to do */
_PyErr_Clear(tstate);
}
printf("\n");
PyErr_Restore(type, value, traceback);
return 1;
}
#endif
Expand Down