mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
gh-106672: C API: Report indiscriminately ignored errors (GH-106674)
Functions which indiscriminately ignore all errors now report them as unraisable errors.
This commit is contained in:
parent
a077b2fbb8
commit
f55cb44359
9 changed files with 195 additions and 45 deletions
|
@ -110,6 +110,9 @@ PySys_GetObject(const char *name)
|
|||
PyObject *value = _PySys_GetObject(tstate->interp, name);
|
||||
/* XXX Suppress a new exception if it was raised and restore
|
||||
* the old one. */
|
||||
if (_PyErr_Occurred(tstate)) {
|
||||
PyErr_FormatUnraisable("Exception ignored in PySys_GetObject()");
|
||||
}
|
||||
_PyErr_SetRaisedException(tstate, exc);
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue