commit | 05b84439a3541ea3a2fdda9f8abfd46b64c431e8 | [log] [tgz] |
---|---|---|
author | Berker Peksag <berker.peksag@gmail.com> | Mon Oct 17 01:05:04 2016 +0300 |
committer | Berker Peksag <berker.peksag@gmail.com> | Mon Oct 17 01:05:04 2016 +0300 |
tree | e3c1054e86b2247190703d9273341048203ad16d | |
parent | 197332ae5a9d4885806b5cceafef650c4e8f8b77 [diff] [blame] |
Issue #21720: Improve exception message when the type of fromlist is unicode
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 @@ 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; }