Commit e80b29b5 authored by Benjamin Peterson's avatar Benjamin Peterson

cleanup Ellipsis and NotImplemented strings after we're done

parent 020bf282
...@@ -2815,18 +2815,24 @@ static int ...@@ -2815,18 +2815,24 @@ static int
save_ellipsis(PicklerObject *self, PyObject *obj) save_ellipsis(PicklerObject *self, PyObject *obj)
{ {
PyObject *str = PyUnicode_FromString("Ellipsis"); PyObject *str = PyUnicode_FromString("Ellipsis");
int res;
if (str == NULL) if (str == NULL)
return -1; return -1;
return save_global(self, Py_Ellipsis, str); res = save_global(self, Py_Ellipsis, str);
Py_DECREF(str);
return res;
} }
static int static int
save_notimplemented(PicklerObject *self, PyObject *obj) save_notimplemented(PicklerObject *self, PyObject *obj)
{ {
PyObject *str = PyUnicode_FromString("NotImplemented"); PyObject *str = PyUnicode_FromString("NotImplemented");
int res;
if (str == NULL) if (str == NULL)
return -1; return -1;
return save_global(self, Py_NotImplemented, str); res = save_global(self, Py_NotImplemented, str);
Py_DECREF(str);
return res;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment