From 95e4f23b098a5b9bf247ac751e186f61d30afe6d Mon Sep 17 00:00:00 2001 From: Jim Fulton Date: Mon, 9 Feb 2004 02:57:18 +0000 Subject: 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. --- Misc/NEWS | 4 ++++ Objects/typeobject.c | 1 + 2 files changed, 5 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index 1304f80..cc5c506 100644 --- 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)? =================================== diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 6c64943..149d2d0 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2567,6 +2567,7 @@ reduce_2(PyObject *obj) goto end; } else { + PyErr_Clear(); state = PyObject_GetAttrString(obj, "__dict__"); if (state == NULL) { PyErr_Clear(); -- cgit v0.12