https://github.com/python/cpython/commit/15313dd3d74490f570a3c361a4176437a8320af6
commit: 15313dd3d74490f570a3c361a4176437a8320af6
branch: main
author: Petr Viktorin <[email protected]>
committer: encukou <[email protected]>
date: 2025-12-12T17:48:43+01:00
summary:

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

files:
M Python/import.c

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);

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to