]> 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>
Mon, 9 Feb 2004 02:57:18 +0000 (02:57 +0000)
committerJim Fulton <jim@zope.com>
Mon, 9 Feb 2004 02:57:18 +0000 (02:57 +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 1304f801885d5d1d63fc3e4c0c363ee532344bd9..cc5c5069b9d5b5161771469b0027a9fb9a93728d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,10 @@ Core and builtins
   segfault in a debug build, but provided less predictable behavior in
   a release build.
 
+- 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.
+
 What's New in Python 2.3.3 (final)?
 ===================================
 
index 6c649433240e9a85f69b0c77af7fcc7e141d4a05..149d2d0d8f356ac5ad6e90e20645e740abc31f03 100644 (file)
@@ -2567,6 +2567,7 @@ reduce_2(PyObject *obj)
                        goto end;
        }
        else {
+               PyErr_Clear();
                state = PyObject_GetAttrString(obj, "__dict__");
                if (state == NULL) {
                        PyErr_Clear();