Commit df71dcbe authored by Benjamin Peterson's avatar Benjamin Peterson

don't overwrite the error from PyObject_GetAttrString (closes #4346)

parent e75f527b
......@@ -10,6 +10,9 @@ What's New in Python 2.7.8?
Core and Builtins
-----------------
- Issue #4346: In PyObject_CallMethod and PyObject_CallMethodObjArgs, don't
overwrite the error set in PyObject_GetAttr.
- Issue #21831: Avoid integer overflow when large sizes and offsets are given to
the buffer type.
......
......@@ -2617,10 +2617,8 @@ PyObject_CallMethod(PyObject *o, char *name, char *format, ...)
return null_error();
func = PyObject_GetAttrString(o, name);
if (func == NULL) {
PyErr_SetString(PyExc_AttributeError, name);
return 0;
}
if (func == NULL)
return NULL;
if (!PyCallable_Check(func)) {
type_error("attribute of type '%.200s' is not callable", func);
......@@ -2656,10 +2654,8 @@ _PyObject_CallMethod_SizeT(PyObject *o, char *name, char *format, ...)
return null_error();
func = PyObject_GetAttrString(o, name);
if (func == NULL) {
PyErr_SetString(PyExc_AttributeError, name);
return 0;
}
if (func == NULL)
return NULL;
if (!PyCallable_Check(func)) {
type_error("attribute of type '%.200s' is not callable", func);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment