mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
bpo-46927: Include the type's name in the error message for subscripting non-generic types (GH-31694)
This commit is contained in:
parent
2031149b9a
commit
ab9301a28f
4 changed files with 8 additions and 3 deletions
|
|
@ -190,6 +190,9 @@ PyObject_GetItem(PyObject *o, PyObject *key)
|
|||
Py_DECREF(meth);
|
||||
return result;
|
||||
}
|
||||
PyErr_Format(PyExc_TypeError, "type '%.200s' is not subscriptable",
|
||||
((PyTypeObject *)o)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return type_error("'%.200s' object is not subscriptable", o);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue