Commit dbd7825d authored by Łukasz Langa's avatar Łukasz Langa

#13842: check whether PyUnicode_FromString succeeded

parent c1f5d8af
...@@ -2814,14 +2814,19 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name) ...@@ -2814,14 +2814,19 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
static int static int
save_ellipsis(PicklerObject *self, PyObject *obj) save_ellipsis(PicklerObject *self, PyObject *obj)
{ {
return save_global(self, Py_Ellipsis, PyUnicode_FromString("Ellipsis")); PyObject *str = PyUnicode_FromString("Ellipsis");
if (str == NULL)
return -1;
return save_global(self, Py_Ellipsis, str);
} }
static int static int
save_notimplemented(PicklerObject *self, PyObject *obj) save_notimplemented(PicklerObject *self, PyObject *obj)
{ {
return save_global(self, Py_NotImplemented, PyObject *str = PyUnicode_FromString("NotImplemented");
PyUnicode_FromString("NotImplemented")); if (str == NULL)
return -1;
return save_global(self, Py_NotImplemented, str);
} }
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