diff options
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c index af47b0b..1d74faf 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2591,8 +2591,9 @@ ensure_fromlist(PyObject *mod, PyObject *fromlist, char *buf, Py_ssize_t buflen, return 0; } if (!PyString_Check(item)) { - PyErr_SetString(PyExc_TypeError, - "Item in ``from list'' not a string"); + PyErr_Format(PyExc_TypeError, + "Item in ``from list'' must be str, not %.200s", + Py_TYPE(item)->tp_name); Py_DECREF(item); return 0; } |