mirror of
https://github.com/python/cpython.git
synced 2025-09-10 18:58:35 +00:00
Use identifier API for PyObject_GetAttrString.
This commit is contained in:
parent
794d567b17
commit
1ee1b6fe0d
28 changed files with 499 additions and 357 deletions
|
@ -465,9 +465,11 @@ PyObject *PyCodec_LookupError(const char *name)
|
|||
|
||||
static void wrong_exception_type(PyObject *exc)
|
||||
{
|
||||
PyObject *type = PyObject_GetAttrString(exc, "__class__");
|
||||
_Py_identifier(__class__);
|
||||
_Py_identifier(__name__);
|
||||
PyObject *type = _PyObject_GetAttrId(exc, &PyId___class__);
|
||||
if (type != NULL) {
|
||||
PyObject *name = PyObject_GetAttrString(type, "__name__");
|
||||
PyObject *name = _PyObject_GetAttrId(type, &PyId___name__);
|
||||
Py_DECREF(type);
|
||||
if (name != NULL) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue