gh-140550: Correct error message for PyModExport (PEP 793) hook (GH-142583)

This commit is contained in:
Petr Viktorin 2025-12-12 17:48:43 +01:00 committed by GitHub
parent 340a684674
commit 15313dd3d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2003,7 +2003,7 @@ import_run_modexport(PyThreadState *tstate, PyModExportFunction ex0,
if (!PyErr_Occurred()) {
PyErr_Format(
PyExc_SystemError,
"slot export function for module %s failed without setting an exception",
"module export hook for module %R failed without setting an exception",
info->name);
}
return NULL;
@ -2011,7 +2011,7 @@ import_run_modexport(PyThreadState *tstate, PyModExportFunction ex0,
if (PyErr_Occurred()) {
PyErr_Format(
PyExc_SystemError,
"slot export function for module %s raised unreported exception",
"module export hook for module %R raised unreported exception",
info->name);
}
PyObject *result = PyModule_FromSlotsAndSpec(slots, spec);