We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8acaa31 commit f76231fCopy full SHA for f76231f
Modules/_pickle.c
@@ -1777,8 +1777,10 @@ fast_save_enter(PicklerObject *self, PyObject *obj)
1777
}
1778
1779
key = PyLong_FromVoidPtr(obj);
1780
- if (key == NULL)
+ if (key == NULL) {
1781
+ self->fast_nesting = -1;
1782
return 0;
1783
+ }
1784
if (PyDict_GetItemWithError(self->fast_memo, key)) {
1785
Py_DECREF(key);
1786
PyErr_Format(PyExc_ValueError,
@@ -1789,6 +1791,8 @@ fast_save_enter(PicklerObject *self, PyObject *obj)
1789
1791
1790
1792
1793
if (PyErr_Occurred()) {
1794
+ Py_DECREF(key);
1795
1796
1797
1798
if (PyDict_SetItem(self->fast_memo, key, Py_None) < 0) {
0 commit comments