mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-99947: Ensure unreported errors are chained for SystemError during import (GH-99946)
This commit is contained in:
parent
a68e585c8b
commit
474220e3a5
4 changed files with 13 additions and 7 deletions
|
|
@ -327,9 +327,10 @@ PyModule_FromDefAndSpec2(PyModuleDef* def, PyObject *spec, int module_api_versio
|
|||
goto error;
|
||||
} else {
|
||||
if (PyErr_Occurred()) {
|
||||
PyErr_Format(PyExc_SystemError,
|
||||
"creation of module %s raised unreported exception",
|
||||
name);
|
||||
_PyErr_FormatFromCause(
|
||||
PyExc_SystemError,
|
||||
"creation of module %s raised unreported exception",
|
||||
name);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
@ -431,7 +432,7 @@ PyModule_ExecDef(PyObject *module, PyModuleDef *def)
|
|||
return -1;
|
||||
}
|
||||
if (PyErr_Occurred()) {
|
||||
PyErr_Format(
|
||||
_PyErr_FormatFromCause(
|
||||
PyExc_SystemError,
|
||||
"execution of module %s raised unreported exception",
|
||||
name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue