diff --git a/Python/import.c b/Python/import.c index 4dd247fac27654..2860ae032dfe29 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);