mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
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.
This commit is contained in:
parent
ee33b27ef0
commit
8a1a594590
2 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
-----------------
|
||||
|
||||
|
|
|
|||
|
|
@ -2581,6 +2581,7 @@ reduce_2(PyObject *obj)
|
|||
goto end;
|
||||
}
|
||||
else {
|
||||
PyErr_Clear();
|
||||
state = PyObject_GetAttrString(obj, "__dict__");
|
||||
if (state == NULL) {
|
||||
PyErr_Clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue