]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-140550: Correct error message for PyModExport (PEP 793) hook (GH-142583)
authorPetr Viktorin <encukou@gmail.com>
Fri, 12 Dec 2025 16:48:43 +0000 (17:48 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Dec 2025 16:48:43 +0000 (17:48 +0100)
Python/import.c

index 4dd247fac276549a4c923689c8f8c91b5468b30b..2860ae032dfe299303ed7e1eb7db38acfa794f5f 100644 (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);