Test for NULL returned from PyObject_NEW().

This commit is contained in:
Guido van Rossum 2000-12-14 15:09:46 +00:00
parent 9e8f4ea0aa
commit adf5410dc4
1 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,9 @@ PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
{
PySliceObject *obj = PyObject_NEW(PySliceObject, &PySlice_Type);
if (obj == NULL)
return NULL;
if (step == NULL) step = Py_None;
Py_INCREF(step);
if (start == NULL) start = Py_None;