Fix SF #749831, copy raises SystemError when getstate raises exception
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 93f34ed..3e15697 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2536,6 +2536,8 @@
 	if (getstate != NULL) {
 		state = PyObject_CallObject(getstate, NULL);
 		Py_DECREF(getstate);
+		if (state == NULL)
+			goto end;
 	}
 	else {
 		state = PyObject_GetAttrString(obj, "__dict__");