mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
handle errors from _PyObject_LookupSpecial when __get__ fails
This commit is contained in:
parent
176a56c69b
commit
87e5006d8c
5 changed files with 40 additions and 8 deletions
|
@ -241,9 +241,12 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__",
|
||||
&reversed_cache);
|
||||
if (reversed_meth == NULL && PyErr_Occurred())
|
||||
return NULL;
|
||||
}
|
||||
if (reversed_meth != NULL) {
|
||||
PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL);
|
||||
Py_DECREF(reversed_meth);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue