mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Test for NULL returned from PyObject_NEW().
This commit is contained in:
parent
9e8f4ea0aa
commit
adf5410dc4
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue