@@ -1731,8 +1731,10 @@ fast_save_enter(PicklerObject *self, PyObject *obj) |
|
|
1731 |
1731 |
} |
1732 |
1732 |
} |
1733 |
1733 |
key = PyLong_FromVoidPtr(obj); |
1734 |
|
-if (key == NULL) |
|
1734 |
+if (key == NULL) { |
|
1735 |
+self->fast_nesting = -1; |
1735 |
1736 |
return 0; |
|
1737 |
+ } |
1736 |
1738 |
if (PyDict_GetItemWithError(self->fast_memo, key)) { |
1737 |
1739 |
Py_DECREF(key); |
1738 |
1740 |
PyErr_Format(PyExc_ValueError, |
@@ -1743,6 +1745,8 @@ fast_save_enter(PicklerObject *self, PyObject *obj) |
|
|
1743 |
1745 |
return 0; |
1744 |
1746 |
} |
1745 |
1747 |
if (PyErr_Occurred()) { |
|
1748 |
+Py_DECREF(key); |
|
1749 |
+self->fast_nesting = -1; |
1746 |
1750 |
return 0; |
1747 |
1751 |
} |
1748 |
1752 |
if (PyDict_SetItem(self->fast_memo, key, Py_None) < 0) { |