Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
  2.  Failure to clear the error when attempts to get the __getstate__
  attribute fail caused intermittent errors and odd behavior.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 6403103..f26ddd6 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2581,6 +2581,7 @@
 			goto end;
 	}
 	else {
+		PyErr_Clear();
 		state = PyObject_GetAttrString(obj, "__dict__");
 		if (state == NULL) {
 			PyErr_Clear();