From: Jim Fulton Date: Mon, 9 Feb 2004 02:57:18 +0000 (+0000) Subject: Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol X-Git-Tag: v2.3.4c1~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95e4f23b098a5b9bf247ac751e186f61d30afe6d;p=thirdparty%2FPython%2Fcpython.git 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/Misc/NEWS b/Misc/NEWS index 1304f801885d..cc5c5069b9d5 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 6c649433240e..149d2d0d8f35 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();