Fix SF #749831, copy raises SystemError when getstate raises exception

This commit is contained in:
Neal Norwitz 2003-06-08 13:19:58 +00:00
parent f0b1a1fca9
commit e2fdc61004
2 changed files with 8 additions and 0 deletions

View file

@ -2536,6 +2536,8 @@ reduce_2(PyObject *obj)
if (getstate != NULL) {
state = PyObject_CallObject(getstate, NULL);
Py_DECREF(getstate);
if (state == NULL)
goto end;
}
else {
state = PyObject_GetAttrString(obj, "__dict__");