From: Petr Viktorin Date: Fri, 12 Dec 2025 16:48:43 +0000 (+0100) Subject: gh-140550: Correct error message for PyModExport (PEP 793) hook (GH-142583) X-Git-Tag: v3.15.0a3~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15313dd3d74490f570a3c361a4176437a8320af6;p=thirdparty%2FPython%2Fcpython.git gh-140550: Correct error message for PyModExport (PEP 793) hook (GH-142583) --- diff --git a/Python/import.c b/Python/import.c index 4dd247fac276..2860ae032dfe 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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);