]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
authorJim Fulton <jim@zope.com>
Sun, 8 Feb 2004 04:21:26 +0000 (04:21 +0000)
committerJim Fulton <jim@zope.com>
Sun, 8 Feb 2004 04:21:26 +0000 (04:21 +0000)
  2.  Failure to clear the error when attempts to get the __getstate__
  attribute fail caused intermittent errors and odd behavior.

Misc/NEWS
Objects/typeobject.c

index 939ce6625188a60e18d7baea6b2f47eb15eeee02..33ff1527ddb29df99d0d16f8443e3ad04948468b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -136,6 +136,10 @@ Core and builtins
   same as split() except that it scans the string from the end
   working towards the beginning.  See SF feature request 801847.
 
+- Fixed a bug in object.__reduce_ex__ when using protocol 2.  Failure
+  to clear the error when attempts to get the __getstate__ attribute
+  fail caused intermittent errors and odd behavior.
+
 Extension modules
 -----------------
 
index 6403103b834c465413b5ebe86c6d81d0798b77fa..f26ddd6bd3b7bdbf6f51b33dedb2b56817d7a7ae 100644 (file)
@@ -2581,6 +2581,7 @@ reduce_2(PyObject *obj)
                        goto end;
        }
        else {
+               PyErr_Clear();
                state = PyObject_GetAttrString(obj, "__dict__");
                if (state == NULL) {
                        PyErr_Clear();