bpo-38530: Make sure that failing to generate suggestions on failure will not propagate exceptions (GH-25408)

This commit is contained in:
Pablo Galindo 2021-04-14 18:58:28 +01:00 committed by GitHub
parent 0c4c436325
commit e07f4ab26a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View file

@ -962,6 +962,8 @@ print_exception(PyObject *f, PyObject *value)
err += PyFile_WriteString("?", f);
}
Py_DECREF(suggestions);
} else if (PyErr_Occurred()) {
PyErr_Clear();
}
err += PyFile_WriteString("\n", f);
Py_XDECREF(tb);